ansible doesn't support commands containing special letters

35 views
Skip to first unread message

曹锐创

unread,
Aug 6, 2014, 8:38:16 PM8/6/14
to ansible...@googlegroups.com
such as "ls && cd .." and " if [ ! -d "/myfolder" ]". so some command can be run at the terminal but not in ansible, sometimes we have to write a script file to enable the command.
Personally thinking, I think this feature could be improved.

Greg Andrews

unread,
Aug 6, 2014, 8:46:34 PM8/6/14
to ansible...@googlegroups.com
Have you tried the shell module instead of the command module?


On Wed, Aug 6, 2014 at 5:38 PM, 曹锐创 <creat...@gmail.com> wrote:
such as "ls && cd .." and " if [ ! -d "/myfolder" ]". so some command can be run at the terminal but not in ansible, sometimes we have to write a script file to enable the command.
Personally thinking, I think this feature could be improved.

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/d4a5a214-1010-4990-bc4e-f6b7c0cdc572%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Brian Coca

unread,
Aug 7, 2014, 10:10:56 AM8/7/14
to ansible...@googlegroups.com

Command module does not support pipes, use shell module

Brian Coca

曹锐创

unread,
Aug 7, 2014, 1:36:58 PM8/7/14
to ansible...@googlegroups.com
Thank you. Even I use shell in my cookbook, I only try to change the line with command.

dI should be more careful.
Reply all
Reply to author
Forward
0 new messages