March 2019
Intermediate to advanced
412 pages
9h 49m
English
Make good use of the inventory structure supported by Ansible when it comes to organizing your network infrastructure, and pay particular attention to grouping. Doing so will make your playbook development much easier. For example, suppose you have two switches on your network—one is a Cumulus Linux Switch, as we examined previously, and the another is a Cisco IOS-based device. Your inventory may look like this:
[switches:children] ios cumulus [ios] ios01 ansible_host=ios01.mastery.example.com[cumulus]cumulus01 ansible_host=cumulus01.mastery.example.com
We know that we cannot run the nclu module on anything other than a cumulus switch, so, with some careful use of the when statement, we can build tasks in playbooks to ensure that ...
Read now
Unlock full access