Improve handling around loop var and correct pvcd

This commit is contained in:
Joshua Boniface 2023-09-01 15:42:19 -04:00
parent 7d34927926
commit fbd0ed9390
2 changed files with 7 additions and 4 deletions

View File

@ -26,5 +26,7 @@
- include: pvc.yml - include: pvc.yml
tags: pvc-pvc tags: pvc-pvc
run_once: true run_once: true
delegate_to: "{{ item }}" delegate_to: "{{ play_host }}"
with_items: "{{ play_hosts }}" with_items: "{{ play_hosts }}"
loop_control:
loop_var: play_host

View File

@ -68,8 +68,9 @@ pvc:
storage: {{ pvc_storage_device }} storage: {{ pvc_storage_device }}
upstream: {{ pvc_upstream_device }} upstream: {{ pvc_upstream_device }}
addresses: addresses:
cluster: {% for node in pvc_nodes if node.hostname == ansible_hostname %}{{ node.cluster_ip }}{% endfor %} cluster: {% for node in pvc_nodes if node.hostname == ansible_hostname %}{{ node.cluster_ip }}/{{ node.cluster_cidr }}{% endfor %}
storage: {% for node in pvc_nodes if node.hostname == ansible_hostname %}{{ node.storage_ip }}{% endfor %} storage: {% for node in pvc_nodes if node.hostname == ansible_hostname %}{{ node.storage_ip }}/{{ node.storage_cidr }}{% endfor %}
upstream: {% for node in pvc_nodes if node.hostname == ansible_hostname %}{{ node.upstream_ip }}/{{ node.upstream_cidr }}{% endfor %}
upstream: {% for node in pvc_nodes if node.hostname == ansible_hostname %}{{ node.upstream_ip }}{% endfor %}