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

icx_vlan has hardcoded stack/module when using the purge option #268

Open
NHGmaniac opened this issue May 6, 2021 · 2 comments · May be fixed by #427
Open

icx_vlan has hardcoded stack/module when using the purge option #268

NHGmaniac opened this issue May 6, 2021 · 2 comments · May be fixed by #427
Labels
bug This issue/PR relates to a bug has_pr module module plugins plugin (any type)

Comments

@NHGmaniac
Copy link

SUMMARY

the values for stack and module are hardcoded in icx_vlan.py, line 537.
the problem becomes visible in this example module invocation:

changed: [aurea] => {
    "changed": true,
    "commands": [
        "vlan 128",
        "vlan 128 name test-vlan",
        "tagged ethernet 1/1/7"
    ],
    "invocation": {
        "module_args": {
            "aggregate": null,
            "associated_interfaces": null,
            "associated_tagged": null,
            "check_running_config": true,
            "delay": 10,
            "interfaces": {
                "name": [
                    "ethernet 1/1/1"
                ],
                "purge": true
            },
            "ip_arp_inspection": null,
            "ip_dhcp_snooping": null,
            "name": "test-vlan",
            "purge": false,
            "state": "present",
            "stp": null,
            "tagged": {
                "name": [
                    "ethernet 1/3/7"
                ],
                "purge": true
            },
            "vlan_id": 128
        }
    }
}

the invocacation specifies ethernet 1/3/7 as tagged for vlan 128, but the resulting commands add interface ethernet 1/1/7 as tagged. the issue does not occur when not using the purge option.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

icx_vlan

ANSIBLE VERSION
ansible 2.10.9
  config file = None
  configured module search path = ['/home/bene/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/bene/.local/lib/python3.9/site-packages/ansible
  executable location = /home/bene/.local/bin/ansible
  python version = 3.9.4 (default, Apr 20 2021, 15:51:38) [GCC 10.2.0]

CONFIGURATION

OS / ENVIRONMENT

target os: ICX 10.1.00T7f5

STEPS TO REPRODUCE

configure vlan with any interface with a module that is not 1 and use the purge option.

    - name: Add ethernet 1/3/7 as tagged and ethernet 1/1/1 as untagged to vlan 128
      community.network.icx_vlan:
        name: test-vlan
        vlan_id: 128
        tagged:
          purge: yes
          name:
            - ethernet 1/3/7
        interfaces:
          purge: yes
          name:
            - ethernet 1/1/1
EXPECTED RESULTS

interface 1/3/7 gets added as tagged to vlan 128

ACTUAL RESULTS

interface 1/1/7 gets added as tagged to vlan 128

TASK [Add ethernet 1/3/7 as tagged and ethernet 1/1/ as untagged to vlan 128] ********************************************************************************
task path: /home/bene/sync/projects/wlandt16ansible/switches.yml:14
Trying secret <ansible.parsing.vault.PromptVaultSecret object at 0x7f7254090ac0> for vault_id=default
Trying secret <ansible.parsing.vault.PromptVaultSecret object at 0x7f7254090ac0> for vault_id=default
Loading collection ansible.netcommon from /home/bene/.ansible/collections/ansible_collections/ansible/netcommon
redirecting (type: terminal) ansible.builtin.icx to community.network.icx
redirecting (type: cliconf) ansible.builtin.icx to community.network.icx
redirecting (type: become) ansible.builtin.enable to ansible.netcommon.enable
<10.128.128.202> attempting to start connection
<10.128.128.202> using connection plugin ansible.netcommon.network_cli
Found ansible-connection at path /home/bene/.local/bin/ansible-connection
<10.128.128.202> found existing local domain socket, using it!
<10.128.128.202> updating play_context for connection
<10.128.128.202> 
<10.128.128.202> local domain socket path is /home/bene/.ansible/pc/ccbaaeec14
Trying secret <ansible.parsing.vault.PromptVaultSecret object at 0x7f7254090ac0> for vault_id=default
<10.128.128.202> ESTABLISH LOCAL CONNECTION FOR USER: bene
<10.128.128.202> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/bene/.ansible/tmp/ansible-local-103952m0zz810k `"&& mkdir "` echo /home/bene/.ansible/tmp/ansible-local-103952m0zz810k/ansible-tmp-1620259835.103415-104260-280742418359513 `" && echo ansible-tmp-1620259835.103415-104260-280742418359513="` echo /home/bene/.ansible/tmp/ansible-local-103952m0zz810k/ansible-tmp-1620259835.103415-104260-280742418359513 `" ) && sleep 0'
Using module file /home/bene/.ansible/collections/ansible_collections/community/network/plugins/modules/icx_vlan.py
<10.128.128.202> PUT /home/bene/.ansible/tmp/ansible-local-103952m0zz810k/tmpprlcaioc TO /home/bene/.ansible/tmp/ansible-local-103952m0zz810k/ansible-tmp-1620259835.103415-104260-280742418359513/AnsiballZ_icx_vlan.py
<10.128.128.202> EXEC /bin/sh -c 'chmod u+x /home/bene/.ansible/tmp/ansible-local-103952m0zz810k/ansible-tmp-1620259835.103415-104260-280742418359513/ /home/bene/.ansible/tmp/ansible-local-103952m0zz810k/ansible-tmp-1620259835.103415-104260-280742418359513/AnsiballZ_icx_vlan.py && sleep 0'
<10.128.128.202> EXEC /bin/sh -c '/usr/bin/python3 /home/bene/.ansible/tmp/ansible-local-103952m0zz810k/ansible-tmp-1620259835.103415-104260-280742418359513/AnsiballZ_icx_vlan.py && sleep 0'
<10.128.128.202> EXEC /bin/sh -c 'rm -f -r /home/bene/.ansible/tmp/ansible-local-103952m0zz810k/ansible-tmp-1620259835.103415-104260-280742418359513/ > /dev/null 2>&1 && sleep 0'
changed: [aurea] => {
    "changed": true,
    "commands": [
        "vlan 128",
        "vlan 128 name test-vlan",
        "tagged ethernet 1/1/7"
    ],
    "invocation": {
        "module_args": {
            "aggregate": null,
            "associated_interfaces": null,
            "associated_tagged": null,
            "check_running_config": true,
            "delay": 10,
            "interfaces": {
                "name": [
                    "ethernet 1/1/1"
                ],
                "purge": true
            },
            "ip_arp_inspection": null,
            "ip_dhcp_snooping": null,
            "name": "test-vlan",
            "purge": false,
            "state": "present",
            "stp": null,
            "tagged": {
                "name": [
                    "ethernet 1/3/7"
                ],
                "purge": true
            },
            "vlan_id": 128
        }
    }
}
META: ran handlers
META: ran handlers

PLAY RECAP ***************************************************************************************************************************************************
aurea                      : ok=2    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   


@ansibullbot
Copy link
Collaborator

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibullbot ansibullbot added bug This issue/PR relates to a bug module module plugins plugin (any type) labels Nov 10, 2021
@ansibullbot
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug has_pr module module plugins plugin (any type)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants