You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ansible...@googlegroups.com
Hi,
Is it possible to pass chdir directive to ad-hoc module?
I would like to do something like that;
ansible server -a 'cd /opt/; java -jar export.jar ' [WRONG, don't use it]
ansible server -a 'java -jar export.jar' -e chdir=/opt/' [WRONG, don't use it]
Toshio Kuratomi
unread,
Dec 2, 2014, 7:57:44 PM12/2/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ansible...@googlegroups.com
If I understand you to mean "ad hoc remote command" then yes. If you
mean to "any of the ansible modules" then no.
Things you can do:
ansible server -a 'chdir=/opt/ pwd'
ansible server -m shell 'cd /opt/; pwd'
Things you can't do:
ansible server -m git -a 'cd /opt/ ; dest=./in/opt'
Note: when no module is specified explicitly, the command module is
used. You can see the chdir parameter and other parameters that
command takes here: http://docs.ansible.com/command_module.html