Open jonipatr opened 3 years ago
To me it seems that VLAN numbers are gathered to the "switchport trunk allowed vlans" by sorting them with first character.
os6_vlan
ansible 2.10.3
COLLECTIONS_PATHS(/etc/ansible/ansible.cfg) = [u'/usr/local/lib/python2.7/dist-packages/ansible_collections', u'/$HOME/.ansible/co DEFAULT_GATHER_SUBSET(/etc/ansible/ansible.cfg) = [u'all'] DEFAULT_GATHER_TIMEOUT(/etc/ansible/ansible.cfg) = 10 DEFAULT_STDOUT_CALLBACK(/etc/ansible/ansible.cfg) = skippy DEFAULT_TIMEOUT(/etc/ansible/ansible.cfg) = 30 HOST_KEY_CHECKING(/etc/ansible/ansible.cfg) = False INTERPRETER_PYTHON(/etc/ansible/ansible.cfg) = auto_silent PERSISTENT_CONNECT_TIMEOUT(/etc/ansible/ansible.cfg) = 30
Machine Description............... Dell EMC Networking Switch System Model ID................... N2024 Version 6.6.0.15
playbook: `---
`interface Gi1/0/20 switchport trunk allowed vlan 5,3404
interface port-channel 1 switchport trunk allowed vlan 5,2509,2514,3404`
ask path: /usr/local/lib/python2.7/dist-packages/ansible_collections/dellemc/os6/roles/os6_vlan/tasks/main.yml:12 changed: [1213-scmga-dcs4g7-mit] => { "ansible_facts": { "discovered_interpreter_python": "/usr/bin/python3" }, "banners": [], "changed": true, "commands": [ "interface Po 1", "switchport trunk allowed vlan 2509,2514,3404-5", "exit", "interface Gi1/0/20", "switchport trunk allowed vlan 3404-5", "exit" ], "invocation": { "module_args": { "after": null, "backup": false, "backup_options": null, "before": null, "config": null, "lines": null, "match": "line", "parents": null, "provider": null, "replace": "line", "save": false, "src": "vlan 3404\nname \"Vlan3404\"\nexit\nvlan 2514\nname \"Vlan2514\"\nexit\ninterface Gi1/0/4\nswitchport access vlan 2514\nexit\ninterface Gi1/0/5\nswitchport access vlan 2514\nexit\nvlan 5\nname \"Vlan5\"\nexit\nvlan 2509\nname \"Vlan2509\"\nexit\ninterface Gi1/0/1\nswitchport access vlan 2509\nexit\ninterface Gi1/0/2\nswitchport access vlan 2509\nexit\ninterface Gi1/0/3\nswitchport access vlan 2509\nexit\ninterface Po 1\nswitchport trunk allowed vlan 2509,2514,3404-5\nexit\ninterface Gi1/0/20\nswitchport trunk allowed vlan 3404-5\nexit\n", "update": "merge" } }, "saved": false, "updates": [ "interface Po 1", "switchport trunk allowed vlan 2509,2514,3404-5", "exit", "interface Gi1/0/20", "switchport trunk allowed vlan 3404-5", "exit" ] } META: ran handlers META: ran handlers
VLAN5 is appended to the end of the vlans with '-' instead of appending to the beginning of the vlans.
Had this Problem too and added a pull request to fix this :)
SUMMARY
To me it seems that VLAN numbers are gathered to the "switchport trunk allowed vlans" by sorting them with first character.
ISSUE TYPE
COMPONENT NAME
os6_vlan
ANSIBLE VERSION
ansible 2.10.3
CONFIGURATION
COLLECTIONS_PATHS(/etc/ansible/ansible.cfg) = [u'/usr/local/lib/python2.7/dist-packages/ansible_collections', u'/$HOME/.ansible/co DEFAULT_GATHER_SUBSET(/etc/ansible/ansible.cfg) = [u'all'] DEFAULT_GATHER_TIMEOUT(/etc/ansible/ansible.cfg) = 10 DEFAULT_STDOUT_CALLBACK(/etc/ansible/ansible.cfg) = skippy DEFAULT_TIMEOUT(/etc/ansible/ansible.cfg) = 30 HOST_KEY_CHECKING(/etc/ansible/ansible.cfg) = False INTERPRETER_PYTHON(/etc/ansible/ansible.cfg) = auto_silent PERSISTENT_CONNECT_TIMEOUT(/etc/ansible/ansible.cfg) = 30
OS / ENVIRONMENT
Machine Description............... Dell EMC Networking Switch System Model ID................... N2024 Version 6.6.0.15
STEPS TO REPRODUCE
playbook: `---
EXPECTED RESULTS
`interface Gi1/0/20 switchport trunk allowed vlan 5,3404
interface port-channel 1 switchport trunk allowed vlan 5,2509,2514,3404`
ACTUAL RESULTS
ask path: /usr/local/lib/python2.7/dist-packages/ansible_collections/dellemc/os6/roles/os6_vlan/tasks/main.yml:12 changed: [1213-scmga-dcs4g7-mit] => { "ansible_facts": { "discovered_interpreter_python": "/usr/bin/python3" }, "banners": [], "changed": true, "commands": [ "interface Po 1", "switchport trunk allowed vlan 2509,2514,3404-5", "exit", "interface Gi1/0/20", "switchport trunk allowed vlan 3404-5", "exit" ], "invocation": { "module_args": { "after": null, "backup": false, "backup_options": null, "before": null, "config": null, "lines": null, "match": "line", "parents": null, "provider": null, "replace": "line", "save": false, "src": "vlan 3404\nname \"Vlan3404\"\nexit\nvlan 2514\nname \"Vlan2514\"\nexit\ninterface Gi1/0/4\nswitchport access vlan 2514\nexit\ninterface Gi1/0/5\nswitchport access vlan 2514\nexit\nvlan 5\nname \"Vlan5\"\nexit\nvlan 2509\nname \"Vlan2509\"\nexit\ninterface Gi1/0/1\nswitchport access vlan 2509\nexit\ninterface Gi1/0/2\nswitchport access vlan 2509\nexit\ninterface Gi1/0/3\nswitchport access vlan 2509\nexit\ninterface Po 1\nswitchport trunk allowed vlan 2509,2514,3404-5\nexit\ninterface Gi1/0/20\nswitchport trunk allowed vlan 3404-5\nexit\n", "update": "merge" } }, "saved": false, "updates": [ "interface Po 1", "switchport trunk allowed vlan 2509,2514,3404-5", "exit", "interface Gi1/0/20", "switchport trunk allowed vlan 3404-5", "exit" ] } META: ran handlers META: ran handlers
VLAN5 is appended to the end of the vlans with '-' instead of appending to the beginning of the vlans.