Skip to content

Commit 4c37f8b

Browse files
committed
Adding junos provider
1 parent 2fb45d5 commit 4c37f8b

File tree

6 files changed

+48
-0
lines changed

6 files changed

+48
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
- name: "junos: configure access port"
3+
junos_command:
4+
commands:
5+
- config
6+
- "delete interfaces {{ port_name }}"
7+
- "set interfaces {{ port_name }} unit 0 family ethernet-switching interface-mode access"
8+
- "set interfaces {{ port_name }} unit 0 family ethernet-switching vlan members {{ _vlan_id }}"
9+
- commit
10+
connection: network_cli
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
- name: "junos: configure trunk port"
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
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
- name: "junos: create vlan"
3+
junos_command:
4+
commands:
5+
- config
6+
- "set vlans {{ _vlan_name }} vlan-id {{ _vlan_id }}"
7+
- commit
8+
connection: network_cli
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
_vlan_id: "{{ vlan_id | default(1, True)}}"
3+
_vlan_name: '{{ vlan_name if vlan_name else "default" if vlan_id|string == "1" else "vlan"+vlan_id|string }}'
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
- name: "junos: delete port"
3+
junos_command:
4+
commands:
5+
- config
6+
- "delete interfaces {{ port_name }}"
7+
- commit
8+
connection: network_cli
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
- name: "junos: delete vlan"
3+
junos_command:
4+
commands:
5+
- config
6+
- "delete vlans {{ _vlan_name }}"
7+
- commit
8+
connection: network_cli

0 commit comments

Comments
 (0)