January 2019
Beginner to intermediate
776 pages
19h 58m
English
Looping over a simple list is nice. However, we often have an entity with more than one attribute associated with it. If you think about the vlan example in the last section, each vlan would have several unique attributes to it, such as the vlan description, the gateway IP address, and possibly others. Oftentimes, we can use a dictionary to represent the entity to incorporate multiple attributes to it.
Let's expand on the vlan example in the last section for a dictionary example in chapter8_6.yml. We defined the dictionary values for three vlans, each with a nested dictionary for the description and the IP address:
<skip> vars: cli: host: "{{ ansible_host }}" username: "{{ username }}" password: "{{ password }}" ...Read now
Unlock full access