How to Loop Over Dictionaries in Ansible
Ansible Tip:
Use the dict2items filter to loop over dictionaries in Ansible.
Here's an example:
---
- name: Example of dict2items filter
hosts: localhost
gather_facts: false
vars:
interfaces:
eth0:
ip: "192.168.1.1/24"
eth1:
ip: "192.168.2.1/24"
tasks: