In this recipe, we will outline how to build and structure the Ansible inventory to describe the network setup outlined in the previous section.
Building an Ansible network inventory
Getting ready
Make sure that Ansible is already installed on the control machine.
How to do it...
- Create a new directory with the following name: ch2_ios.
- Inside this new folder, create the hosts file with the following content:
$ cat hosts
[access]
access01 Ansible_host=172.20.1.18
access02 Ansible_host=172.20.1.19
[core]
core01 Ansible_host=172.20.1.20
core02 Ansible_host=172.20.1...