Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve performance of the NOS driver #74

Open
wants to merge 3 commits into
base: devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
- "switchport trunk allowed vlan add {{ _vlan_id }}"
parents:
- "interface {{ port_name }}"
match: none
connection: network_cli
Original file line number Diff line number Diff line change
@@ -1,36 +1,15 @@
---
- name: "nos: reset interface to default"
- name: "nos: restore config and then configure access port"
community.network.nos_config:
lines:
- "no switchport"
- "shutdown"
parents:
- "interface {{ port_name }}"
connection: network_cli

- name: "nos: enable switchport in access mode"
community.network.nos_config:
lines:
- "switchport"
- "switchport mode access"
- "no shutdown"
parents:
- "interface {{ port_name }}"
connection: network_cli

- name: "nos: enable rstp"
community.network.nos_config:
lines:
- "no spanning-tree shutdown"
parents:
- "interface {{ port_name }}"
connection: network_cli
when: stp_edge

- name: "nos: set access mode vlan"
community.network.nos_config:
lines:
- "switchport access vlan {{ _vlan_id }}"
parents:
- "interface {{ port_name }}"
match: none
connection: network_cli
Original file line number Diff line number Diff line change
@@ -1,48 +1,28 @@
---
- name: "nos: reset interface to default"
- name: "nos: reset interface to default and then configure it in trunk mode with native-vlan"
community.network.nos_config:
lines:
- "no switchport"
- "shutdown"
parents:
- "interface {{ port_name }}"
connection: network_cli

- name: "nos: enable switchport in trunk mode and disable tagging of native-vlan"
community.network.nos_config:
lines:
- "switchport"
- "switchport mode trunk"
- "no switchport trunk tag native-vlan"
- "no shutdown"
parents:
- "interface {{ port_name }}"
connection: network_cli

- name: "nos: enable rstp"
community.network.nos_config:
lines:
- "no spanning-tree shutdown"
parents:
- "interface {{ port_name }}"
connection: network_cli
when: stp_edge

- name: "nos: set native vlan"
community.network.nos_config:
lines:
- "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 trunk vlan(s)"
- 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
- "name {{ _vlan_name }}"
parents:
- "interface vlan {{ _vlan_id }}"
match: none
connection: network_cli
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
- "shutdown"
parents:
- "interface {{ port_name }}"
match: none
connection: network_cli
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
- "switchport trunk allowed vlan remove {{ _vlan_id }}"
parents:
- "interface {{ port_name }}"
match: none
connection: network_cli
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
community.network.nos_config:
lines:
- "no interface vlan {{ _vlan_id }}"
match: none
connection: network_cli