How is the ansible adhoc command line structured?



  • Link: http://docs.ansible.com/ansible/setup_module.html
    man ansible: http://lightnetics.nodebb.com/post/884

    For 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 module

    This 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
    

Log in to reply
 

© Lightnetics 2024