Parallelism in Ansible
- Ansible execution happens parallely by default in 5 nodes task by task
- This number can be changed by using fork
ansible-playbook -f 10 .... - Refer Here for ansible execution strategies
Ansible Vault
- Ansible Vault can protect sensitive information Refer Here
- It is recommended to use password-file approach
- Watch classroom video for instructions
Ansible Configurations
- Refer Here for configuration file settings
Ansible Dynamic inventory
- To fetch the list of nodes we can use dynamic inventory
- Ansible has inventory plugins
- aws Refer Here
- To the ansible we can pass any script as dynamic inventory which returns a json file
{
"_meta": {
"hostvars": { }
},
"instances": {
"hosts": ["localhost"]
}
}
Exercise
- How is ansible used in CI/CD Pipeline
- Ansible usage in CI/CD Pipeline
- Create an ansible playbook
- to install nopcommerce
- to install mysql
