Browse Source

Add Trunk support to Junos ansible provider

Change-Id: Ia59023f0aeda0d608ddc23924cb31fb643c6ccdb
(cherry picked from commit 378b9e618f)
changes/07/679307/1
Dan Radez 8 months ago
parent
commit
87f6ca67c1

+ 1
- 2
README.rst View File

@@ -35,6 +35,5 @@ Ironic provisioning network and the tenant VLAN that the guest is assigned.
35 35
 
36 36
 Features
37 37
 --------
38
-
39 38
 * On create network a vlan can be defined
40
-* On port update will assign a vlan to an access port
39
+* On port update will assign a vlan to an access port or trunk port.

+ 10
- 2
etc/ansible/roles/openstack-ml2/providers/junos/conf_trunk_port.yaml View File

@@ -1,3 +1,11 @@
1 1
 ---
2
-- fail:
3
-    msg: Trunk port configuration is not implimented for junos
2
+- name: "junos: run configure trunk port using network_cli"
3
+  junos_command:
4
+    commands:
5
+      - config
6
+      - "delete interfaces {{ port_name }}"
7
+      - "set interfaces {{ port_name }} unit 0 family ethernet-switching interface-mode trunk"
8
+      - "set interfaces {{ port_name }} native-vlan {{ _vlan_id }}"
9
+      - "set interfaces {{ port_name }} unit 0 family ethernet-switching vlan members [{{ _vlan_id }}{% for vlan in trunked_vlans %} {{ vlan }}{% endfor %}]"
10
+      - commit
11
+  connection: network_cli

+ 3
- 3
etc/ansible/roles/openstack-ml2/tasks/conf_trunk_port.yaml View File

@@ -1,9 +1,9 @@
1 1
 ---
2 2
 # delegate task to localhost to avoid starting the device connection
3
-- name: "check for required fact: port"
3
+- name: "check for required fact: port_name"
4 4
   fail:
5
-    msg: "missing required fact: port"
6
-  when: not port
5
+    msg: "missing required fact: port_name"
6
+  when: not port_name
7 7
   delegate_to: localhost
8 8
 
9 9
 # delegate task to localhost to avoid starting the device connection

Loading…
Cancel
Save