Improve handling around loop var and correct pvcd

This commit is contained in:
Joshua Boniface 2019-06-11 16:37:44 -04:00
parent 46a3bdb0bb
commit 2320f50621
2 changed files with 7 additions and 4 deletions

View File

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

View File

@ -68,8 +68,9 @@ pvc:
storage: {{ pvc_storage_device }}
upstream: {{ pvc_upstream_device }}
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 %}