Browse Source

Add Trunk support to Junos ansible provider

Change-Id: Ia59023f0aeda0d608ddc23924cb31fb643c6ccdb
Dan Radez 3 months ago
parent
commit
378b9e618f

+ 1
- 1
README.rst View File

@@ -57,7 +57,7 @@ The following matrix indicates which features have been implmented.
57 57
 +--------------------+-------------+-------+------+-----+---------+
58 58
 | Config Access Port |      Y      |   Y   |  Y   |  Y  |    Y    |
59 59
 +--------------------+-------------+-------+------+-----+---------+
60
-| Config Trunk Port  |      N      |   N   |  N   |  N  |    N    |
60
+| Config Trunk Port  |      N      |   Y   |  N   |  N  |    N    |
61 61
 +--------------------+-------------+-------+------+-----+---------+
62 62
 
63 63
 ML2 Implimentation Mapping

+ 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