By default, Ansible runs tasks in parallel. In this recipe, we will outline how to control the parallel execution of Ansible and how we can modify this default behavior. We will also explore the concept of rolling updates and how to utilize them in Ansible.
Controlling parallelism and rolling updates in Ansible
How to do it...
- Update the ansible.cfg file to control parallel execution, as shown in the following code snippet:
[defaults]
forks=2
- Update the pb_push_acl.yml file to set up rolling updates for the configuration push on the network devices, as shown in the following code block:
- name: Configure ACL on IOS-XR
hosts: all
serial: 1
tags: deploy
tasks:
- name: Backup Config
iosxr_config:
backup...