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

-Toshio

On Tue, Dec 2, 2014 at 3:44 AM, Serkan C. <[email protected]> wrote:
> 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]
>
>
> --
> 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 [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/9fde79f4-86ef-4150-83a7-57e9442e809c%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAG9juEoREhrNQ4tTKh9DcLJ5VK87d5rJ0Ryj2pUmU1Entbmj4g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to