summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2019-01-24 12:16:11 +0000
committerGerrit Code Review <review@openstack.org>2019-01-24 12:16:11 +0000
commitcce734c667a726c6b6cc90fa6d7ae0562a051b9e (patch)
tree7339d5c33f2b212638e7ceaa2105c84c11a242d0
parentcaebca1387f0ec1bbf218ee963381169856a36c4 (diff)
parent9853d3608f89cec205dd46ec0197fbad09c18ae8 (diff)
Merge "Default private_ipv4 to use public_ipv4 address when null"
-rw-r--r--roles/multi-node-bridge/tasks/peer.yaml31
1 files changed, 21 insertions, 10 deletions
diff --git a/roles/multi-node-bridge/tasks/peer.yaml b/roles/multi-node-bridge/tasks/peer.yaml
index 65f8f9a..8eeba12 100644
--- a/roles/multi-node-bridge/tasks/peer.yaml
+++ b/roles/multi-node-bridge/tasks/peer.yaml
@@ -9,19 +9,30 @@
9 vni: "{{ offset | int + bridge_vni_offset | int }}" 9 vni: "{{ offset | int + bridge_vni_offset | int }}"
10 10
11# To make things more readable in the following tasks 11# To make things more readable in the following tasks
12- name: Set ip address when the node private IP is not set
13 set_fact:
14 nodepool_ip: |
15 {{ nodepool.private_ipv4 | default(nodepool.public_ipv4) }}
16
17- name: Select the switch from group
18 set_fact:
19 switch: "{{ groups['switch'][0] }}"
20
12- name: Alias the primary node private IP 21- name: Alias the primary node private IP
13 set_fact: 22 set_fact:
14 switch_private_ip: "{{ hostvars[groups['switch'][0]]['nodepool']['private_ipv4'] }}" 23 switch_ip: |
24 {{ hostvars[switch].nodepool.private_ipv4 |
25 default(hostvars[switch].nodepool.public_ipv4) }}
15 26
16- name: Add port to bridge on switch node 27- name: Add port to bridge on switch node
17 become: yes 28 become: yes
18 command: >- 29 command: >-
19 ovs-vsctl --may-exist add-port {{ bridge_name }} 30 ovs-vsctl --may-exist add-port {{ bridge_name }}
20 {{ bridge_name }}_{{ nodepool['private_ipv4'] }} 31 {{ bridge_name }}_{{ nodepool_ip }}
21 -- set interface {{ bridge_name }}_{{ nodepool['private_ipv4'] }} 32 -- set interface {{ bridge_name }}_{{ nodepool_ip}}
22 type=vxlan options:remote_ip={{ nodepool['private_ipv4'] }} options:key={{ vni }} 33 type=vxlan options:remote_ip={{ nodepool_ip }} options:key={{ vni }}
23 options:local_ip={{ switch_private_ip }} 34 options:local_ip={{ switch_ip }}
24 delegate_to: "{{ groups['switch'][0] }}" 35 delegate_to: "{{ switch }}"
25 36
26- name: Create bridge on peer node 37- name: Create bridge on peer node
27 become: yes 38 become: yes
@@ -36,10 +47,10 @@
36 become: yes 47 become: yes
37 command: >- 48 command: >-
38 ovs-vsctl --may-exist add-port {{ bridge_name }} 49 ovs-vsctl --may-exist add-port {{ bridge_name }}
39 {{ bridge_name }}_{{ switch_private_ip }} 50 {{ bridge_name }}_{{ switch_ip }}
40 -- set interface {{ bridge_name }}_{{ switch_private_ip }} 51 -- set interface {{ bridge_name }}_{{ switch_ip }}
41 type=vxlan options:remote_ip={{ switch_private_ip }} options:key={{ vni }} 52 type=vxlan options:remote_ip={{ switch_ip }} options:key={{ vni }}
42 options:local_ip={{ nodepool['private_ipv4'] }} 53 options:local_ip={{ nodepool_ip }}
43 54
44- when: bridge_configure_address 55- when: bridge_configure_address
45 block: 56 block: