2019-06-12 10:33:48 -04:00
|
|
|
---
|
2020-07-27 12:35:50 -04:00
|
|
|
- name: bring up interfaces
|
2020-01-12 19:45:47 -05:00
|
|
|
command: ifup {{ item }}
|
2020-04-06 12:32:52 -04:00
|
|
|
with_items: "{% for network in networks %}{{ networks[network].device }} {% endfor %}"
|
2020-07-27 12:35:50 -04:00
|
|
|
ignore_errors: yes
|
2020-04-06 12:32:52 -04:00
|
|
|
|
|
|
|
- name: set bridges dictionary (cluster != storage)
|
|
|
|
set_fact:
|
|
|
|
bridges:
|
|
|
|
- { "bridge": "brupstream", "device": "{{ pvc_upstream_device }}" }
|
|
|
|
- { "bridge": "brcluster", "device": "{{ pvc_cluster_device }}" }
|
|
|
|
- { "bridge": "brstorage", "device": "{{ pvc_storage_device }}" }
|
|
|
|
when: pvc_storage_device != pvc_cluster_device
|
|
|
|
|
|
|
|
- name: set bridges dictionary (cluster == storage)
|
|
|
|
set_fact:
|
|
|
|
bridges:
|
|
|
|
- { "bridge": "brupstream", "device": "{{ pvc_upstream_device }}" }
|
|
|
|
- { "bridge": "brcluster", "device": "{{ pvc_cluster_device }}" }
|
|
|
|
when: pvc_storage_device == pvc_cluster_device
|
2020-01-12 19:45:47 -05:00
|
|
|
|
2020-04-06 12:32:52 -04:00
|
|
|
- name: create bridge interfaces
|
|
|
|
command: brctl addbr {{ item.bridge }}
|
2019-06-16 19:17:41 -04:00
|
|
|
ignore_errors: yes
|
2020-01-12 19:45:47 -05:00
|
|
|
with_items:
|
2020-04-06 12:32:52 -04:00
|
|
|
- "{{ bridges }}"
|
2019-06-16 19:17:41 -04:00
|
|
|
|
2020-01-12 19:45:47 -05:00
|
|
|
- name: add underlying interfaces to bridges
|
|
|
|
command: brctl addif {{ item.bridge }} {{ item.device }}
|
2019-06-16 19:17:41 -04:00
|
|
|
ignore_errors: yes
|
2020-01-12 19:45:47 -05:00
|
|
|
with_items:
|
2020-04-06 12:32:52 -04:00
|
|
|
- "{{ bridges }}"
|
2019-06-16 19:17:41 -04:00
|
|
|
|
2020-01-12 19:45:47 -05:00
|
|
|
- name: set bridge interfaces up
|
2020-04-06 12:32:52 -04:00
|
|
|
command: ip link set {{ item.bridge }} up
|
2019-06-16 19:17:41 -04:00
|
|
|
ignore_errors: yes
|
2020-01-12 19:45:47 -05:00
|
|
|
with_items:
|
2020-04-06 12:32:52 -04:00
|
|
|
- "{{ bridges }}"
|
|
|
|
|
|
|
|
- name: add IP addresses to upstream bridge
|
2021-11-11 17:14:34 -05:00
|
|
|
command: ip address add {% for node in pvc_nodes if node.hostname == this_node %}{{ node.upstream_ip }}/{{ pvc_upstream_netmask }}{% endfor %} dev brupstream
|
2020-04-06 12:32:52 -04:00
|
|
|
ignore_errors: yes
|
2019-12-24 14:16:20 -05:00
|
|
|
|
2020-01-12 19:45:47 -05:00
|
|
|
- name: add IP addresses to cluster bridge
|
2021-11-11 17:14:34 -05:00
|
|
|
command: ip address add {% for node in pvc_nodes if node.hostname == this_node %}{{ node.cluster_ip }}/{{ pvc_cluster_netmask }}{% endfor %} dev brcluster
|
2019-06-12 10:33:48 -04:00
|
|
|
ignore_errors: yes
|
|
|
|
|
2020-04-06 12:32:52 -04:00
|
|
|
- name: add IP addresses to storage bridge (will error if storage == cluster)
|
2021-11-11 17:14:34 -05:00
|
|
|
command: ip address add {% for node in pvc_nodes if node.hostname == this_node %}{{ node.storage_ip }}/{{ pvc_storage_netmask }}{% endfor %} dev brstorage
|
2019-06-12 10:33:48 -04:00
|
|
|
ignore_errors: yes
|