Browse Source

Merge "Adding cumulus support to the openstack-ml2 role"

Zuul 6 months ago
parent
commit
b55cecd4cd

+ 5
- 0
etc/ansible/roles/openstack-ml2/providers/cumulus/create_network.yaml View File

@@ -0,0 +1,5 @@
1
+---
2
+- name: "nclu: run create_network using nclu"
3
+  nclu:
4
+    commands: "add vlan {{ ml2_segmentation_id }}"
5
+    commit: true

+ 3
- 0
etc/ansible/roles/openstack-ml2/providers/cumulus/defaults.yaml View File

@@ -0,0 +1,3 @@
1
+---
2
+ml2_segmentation_id: "{{ segmentation_id | default(1, True)}}"
3
+ml2_segmentation_name: '{{segmentation_name if segmentation_name else "default" if ml2_segmentation_id|string == "1" else "vlan"+segmentation_id|string }}'

+ 5
- 0
etc/ansible/roles/openstack-ml2/providers/cumulus/delete_network.yaml View File

@@ -0,0 +1,5 @@
1
+---
2
+- name: "cumulus: run delete_network using nclu"
3
+  nclu:
4
+    commands: 'del vlan {{ ml2_segmentation_id }}'
5
+    commit: true

+ 24
- 0
etc/ansible/roles/openstack-ml2/providers/cumulus/delete_port.yaml View File

@@ -0,0 +1,24 @@
1
+---
2
+- name: "cumulus: get interfaces"
3
+  nclu:
4
+    commands: "show interface {{ ml2_port_name }} json"
5
+  register: output
6
+
7
+- name: "cumulus: set port facts"
8
+  set_fact:
9
+    interface: "{{ output.msg }}"
10
+
11
+- name: "cumulus: verify port exists"
12
+  fail:
13
+    msg: "port {{ ml2_port_name }} does not exist on this device"
14
+  when: interface.mode == 'NotConfigured'
15
+
16
+- name: "cumulus: remove port configuration"
17
+  nclu:
18
+    commands: "del interface {{ ml2_port_name }}"
19
+    commit: true
20
+
21
+- name: "cumulus: administratively disable the port"
22
+  nclu:
23
+    commands: "add interface {{ ml2_port_name }} link down"
24
+    commit: true

+ 14
- 0
etc/ansible/roles/openstack-ml2/providers/cumulus/update_port.yaml View File

@@ -0,0 +1,14 @@
1
+---
2
+- name: "cumulus: port is configured as routed"
3
+  block:
4
+    - name: "cumulus: reset interface to defaults"
5
+      nclu:
6
+        commands: "del interface {{ ml2_port_name }}"
7
+        commit: true
8
+
9
+    - name: "cumulus: build port configuration"
10
+      nclu:
11
+        commands:
12
+          - "add interface {{ ml2_port_name }} bridge access {{ ml2_segmentation_id }}"
13
+          - "del interface {{ ml2_port_name }} link down"
14
+        commit: true

Loading…
Cancel
Save