On 01.03.2019 08:36, Bipin Guragain wrote:
I am new to Ansible and started using it for a while. I have one
question
on Ansible Ad-hoc command using a shell module with a passed args
'chdir'.
I am having a problem using the argument 'chdir' in Ansible CLI. The
same
works if i try to include in my playbook but don't know why it can't be
accomplished via CLI.
Few question that came across on my mind
1. Are all the features supported in playbook is equally supported in
Ansible CLI ?
2. If the step 1 is true then what is the best pattern to pass args in
CLI?
The command that I try to execute via CLI is
ansible all -m shell -a "chdir /tmp ; wc-l" (--consider every set up
and
connection has been established between all of my hosts defined in
default
inventory file )
In a nutshell--I am trying to change the directory using chdir only via
CLI.
Any suggestion will be really appreciated for this newbie. ;)
This will run the pwd command in the /etc directory
ansible all -m shell -a 'pwd chdir=/etc'
--
Kai Stian Olstad
--
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/faed742b04c881ae4d669a7daab12e87%40olstad.com.
For more options, visit https://groups.google.com/d/optout.