Changes

Jump to navigation Jump to search
71 bytes added ,  15:30, 26 September 2017
link to the docs on setup
source ./hacking/env-setup
</source>
 
 
If you see this error message:
== Modules ==
Ansible comes with [https://docs.ansible.com/ansible/modules_by_category.html over 200 modules] that you should get familiar with in order to use the system effectively.
 
There are a bunch of modules in Ansible, like the [https://docs.ansible.com/ansible/mysql_db_module.html MySQL module], the [https://docs.ansible.com/ansible/monit_module.html Monit module], or the [https://docs.ansible.com/ansible/file_module.html File module] and other interesting modules like jabber, mail, sendgrid, dpkg_selections, composer, yum, redhat_subscription, [https://github.com/ansible/ansible-modules-core/blob/devel/cloud/digital_ocean/digital_ocean.py digital ocean], the [https://docs.ansible.com/ansible/authorized_key_module.html authorized_key module] for working with SSH keys, and a whole section of [https://docs.ansible.com/ansible/list_of_system_modules.html system modules].
 
You can use the '''command module''' (secure but simple) or the '''[https://docs.ansible.com/ansible/shell_module.html shell module]'''. The latter may be useful if you need to run bash explicitly (defaults to /bin/sh); or anytime you need $HOME and redirection.
Note: control verbosity with <code>-vvvv</code>
# <code>ansible -c local -i ~/ansible_hosts -m ping all</code> ping all the hosts in the inventory file
# <code>ansible '''-m setup''' wiki.example.com</code> will show you all Use the '''[https://docs.ansible.com/ansible/latest/setup_module.html setup]''' module to gather ansible 'facts' (aka [[ansible_variables]]) about that host.
# <code>ansible '''localhost''' -m setup -a 'gather_subset=!all'</code> or look at the localhost
# <code>ansible all -m setup -a '''"filter=ansible_distribution*"'''</code> use a filter action to see specific variables
4,558

edits

Navigation menu