ansible-pull : To run the ansible yml file from GITHub repo url to local the receiver server in which ansible installed we use ansible-pull command Ex : ansible-pull -i localhost, -u GitHUbURl
Ansible ad-hoc command example
- ansible -i /tmp/inv all -e ansible_username=centos -e ansible_password=***** abc.yml
Ansible variables
- Variable are accessed as {{ variable_name }}
- Ansible supports both double and single quotes
- If a value starts with variable the quote are mandatory other wise not mandatory
- Play level Variables are accessible with in all the tasks under that play
- Variable taken from files into playbook are accessible to plays not constrained to individual tasks(task level).
- Variables Precedence
- Variables from CLI
- Variables from tasks
- Variables from roles
- Variables from files
- Variables from plays
- Variables from Inventory
- Variables from defaults
- Variables from one task to another task can be done using "register" keyword