vips:
- name: cluster1_vip
ip : 1.2.3.4
- name: cluster1.othervip
ip : 1.2.3.5vips:
- name: cluster2_vip
ip : 1.2.4.4
- name: cluster2.othervip
ip : 1.2.4.5[firstcluster]
node10
node11
[secondcluster]
node20
node21{% for group in <THEMAGICVAR> %}
{% for vip in group.vips %}
{{ vip.name }} IN A {{ vip.ip }}
{% end for %}
{% end for %}all_vips:
- name: cluster1_vip
ip : 1.2.3.4
otherattr: yes
- name: cluster1_othervip
ip : 1.2.3.5
otherattr: yes
- name: cluster2_vip
ip : 1.2.4.4
otherattr: yes
- name: cluster2_othervip
ip : 1.2.4.5
otherattr: yesvips:
- cluster1_vip
- cluster1_othervipvips:
- cluster2_vip
- cluster2_othervip{% for vip in all_vips %}
{{ vip.name }} IN A {{ vip.ip }}
{% end for %}
{% for vip_name in vips %}
{% for vip in all_vips|selectattr("name", "equalto", vip_name) %}
virtual server {{ vip.name }} {{ vip.ip }}
{% endfor %}{# vip #}
{% endfor %}{# vip_name #}