How is the ansible adhoc command line structured?
-
Link: http://docs.ansible.com/ansible/setup_module.html
man ansible: http://lightnetics.nodebb.com/post/884For instance:
$ ansible perth -m setup
ansible - obviously the command
perth the host group when using the default ansible host inventory /etc/ansible/hosts
-m for the module
setup - the actual ansible moduleThis will produce a list of facts for the group of hosts defines in perth.
If you were using a host inventory in a different locaton you can use the -i option to specify the path
For example:
$ ansible perth -i /home/ansible/myhosts -m setup
If you wanted all hosts defined in /home/ansible/myhosts, replace perth with "all"
$ ansible all -i /home/ansible/myhosts -m setup
© Lightnetics 2024