forked from ansible-network/network-runner
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Apply changes from ansible-network#74
- Loading branch information
Showing
10 changed files
with
97 additions
and
0 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
etc/ansible/roles/network-runner/providers/nos/add_trunk_vlan.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
- name: "nos: Add a vlan to a trunk port" | ||
community.network.nos_config: | ||
lines: | ||
- "switchport trunk allowed vlan add {{ _vlan_id }}" | ||
parents: | ||
- "interface {{ port_name }}" | ||
match: none | ||
connection: network_cli |
15 changes: 15 additions & 0 deletions
15
etc/ansible/roles/network-runner/providers/nos/conf_access_port.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
- name: "nos: restore config and then configure access port" | ||
community.network.nos_config: | ||
lines: | ||
- "no switchport" | ||
- "shutdown" | ||
- "switchport" | ||
- "switchport mode access" | ||
- "no shutdown" | ||
- "no spanning-tree shutdown" | ||
- "switchport access vlan {{ _vlan_id }}" | ||
parents: | ||
- "interface {{ port_name }}" | ||
match: none | ||
connection: network_cli |
29 changes: 29 additions & 0 deletions
29
etc/ansible/roles/network-runner/providers/nos/conf_trunk_port.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
- name: "nos: reset interface to default and then configure it in trunk mode with native-vlan" | ||
community.network.nos_config: | ||
lines: | ||
- "no switchport" | ||
- "shutdown" | ||
- "switchport" | ||
- "switchport mode trunk" | ||
- "no switchport trunk tag native-vlan" | ||
- "no shutdown" | ||
- "no spanning-tree shutdown" | ||
- "switchport trunk allowed vlan add {{ _vlan_id }}" | ||
- "switchport trunk native-vlan {{ _vlan_id }}" | ||
parents: | ||
- "interface {{ port_name }}" | ||
match: none | ||
connection: network_cli | ||
|
||
- name: "nos: add the remainder of trunk vlan(s)" | ||
community.network.nos_config: | ||
lines: | ||
- "switchport trunk allowed vlan add {{ t_vlan }}" | ||
parents: | ||
- "interface {{ port_name }}" | ||
match: none | ||
loop: "{{ trunked_vlans }}" | ||
loop_control: | ||
loop_var: t_vlan | ||
connection: network_cli |
9 changes: 9 additions & 0 deletions
9
etc/ansible/roles/network-runner/providers/nos/create_vlan.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
- name: "nos: create vlan" | ||
community.network.nos_config: | ||
lines: | ||
- "name {{ _vlan_name }}" | ||
parents: | ||
- "interface vlan {{ _vlan_id }}" | ||
match: none | ||
connection: network_cli |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
_vlan_id: "{{ vlan_id | default(1, True)}}" | ||
_vlan_name: '{{ vlan_name if vlan_name else "default" if vlan_id|string == "1" else "vlan"+vlan_id|string }}' |
10 changes: 10 additions & 0 deletions
10
etc/ansible/roles/network-runner/providers/nos/delete_port.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
- name: "nos: reset interface to default (no switchport and shutdown)" | ||
community.network.nos_config: | ||
lines: | ||
- "no switchport" | ||
- "shutdown" | ||
parents: | ||
- "interface {{ port_name }}" | ||
match: none | ||
connection: network_cli |
9 changes: 9 additions & 0 deletions
9
etc/ansible/roles/network-runner/providers/nos/delete_trunk_vlan.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
- name: "nos: Remove vlan from a trunk port" | ||
community.network.nos_config: | ||
lines: | ||
- "switchport trunk allowed vlan remove {{ _vlan_id }}" | ||
parents: | ||
- "interface {{ port_name }}" | ||
match: none | ||
connection: network_cli |
7 changes: 7 additions & 0 deletions
7
etc/ansible/roles/network-runner/providers/nos/delete_vlan.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
- name: "nos: delete vlan" | ||
community.network.nos_config: | ||
lines: | ||
- "no interface vlan {{ _vlan_id }}" | ||
match: none | ||
connection: network_cli |
3 changes: 3 additions & 0 deletions
3
etc/ansible/roles/network-runner/providers/nos/get_port_conf.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
- fail: | ||
msg: Get Port Conf is not implemented for nos |
3 changes: 3 additions & 0 deletions
3
etc/ansible/roles/network-runner/providers/nos/list_vlans.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
- fail: | ||
msg: List VLANs is not implemented for nos |