Test Host connection
Defining Targets
You can also specify multiple hosts and groups by separating them with colons:
Runing modules
- Probably u will need to use the setup module
- To execute a module with arguments, include the -a flag followed
by the appropriate options in double quotes
- U can use whatever the cmd with -a
ansible -i hosts servers -m setup -a ‘filter: ansible_distribution’ ansible servers -i hosts -m file -a ‘state: directory path=/opt/deployment’
Setup module
- pages of information about the server that can be used as variable in the playbooks later
Run as root
Ansible Debuging
U can skip the deubiging message by using etiher the: - Verbosity
Level in ur playbook - Just use -vvv
flag
Ansible Roles
Init a role