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

Add support decode bitmap for ce_switchport module #315

Closed
efrikin opened this issue Oct 14, 2021 · 2 comments · Fixed by #316
Closed

Add support decode bitmap for ce_switchport module #315

efrikin opened this issue Oct 14, 2021 · 2 comments · Fixed by #316
Labels
feature This issue/PR relates to a feature request has_pr module module plugins plugin (any type)

Comments

@efrikin
Copy link
Contributor

efrikin commented Oct 14, 2021

SUMMARY

Currently, ansible module ce_switchport return few values as bitmap for trunk and hybrid modes.
This is not user frendly format for reading and will be better if we can see diff state between end_state and proposed.

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

community.network.ce_switchport

ADDITIONAL INFORMATION
- hosts: sw
  gather_facts: false
  vars:
    ansible_connection: ansible.netcommon.netconf
    ansible_user: root
    ansible_password: PASSWD
    ce__create_vlan: 3000

  tasks:
    - name: Create vlans to {{ inventory_hostname }}
      community.network.ce_vlan:
        vlan_id: "{{ ce__create_vlan }}"
        state: present

    - name: Test ce_switchport
      community.network.ce_switchport:
        interface: "40GE2/1/1"
        mode: trunk
        trunk_vlans: "{{ ce__create_vlan }}"
$ ansible-playbook -i inventory.yml playbook.yml -vvv

TASK [Create vlans to 10.10.10.10] ********************************************************************************************************************************
ok: [10.10.10.10]

TASK [Test ce_switchport] *******************************************************************************************************************************************
...
ok: [10.10.10.10] => {
    "changed": false,
    "end_state": {
        "interface": "40GE2/1/1",
        "mode": "trunk",
        "switchport": "enable",
        "trunk_pvid": "1",
        "trunk_vlans": "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000C000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
    },
    "existing": {
        "interface": "40GE2/1/1",
        "mode": "trunk",
       "switchport": "enable",
        "trunk_pvid": "1",
        "trunk_vlans": "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000C000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
    },
    "invocation": {
        "module_args": {
            "default_vlan": null,
            "interface": "40GE2/1/1",
            "mode": "trunk",
            "provider": null,
            "pvid_vlan": null,
            "state": "present",
            "tagged_vlans": null,
            "trunk_vlans": "3000",
            "untagged_vlans": null
        }
    },
    "proposed": {
        "interface": "40GE2/1/1",
        "mode": "trunk",
        "pvid_vlan": null,
        "state": "present",
        "trunk_vlans": "3000"
    },
    "updates": []
}

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

From log above we can see, that trunk_vlans in existing and end_state in bitmap format

@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 feature This issue/PR relates to a feature request has_pr 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
feature This issue/PR relates to a feature request has_pr module module plugins plugin (any type)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants