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

idempotency ? #48

Open
tfuzeau opened this issue Apr 26, 2022 · 0 comments
Open

idempotency ? #48

tfuzeau opened this issue Apr 26, 2022 · 0 comments

Comments

@tfuzeau
Copy link

tfuzeau commented Apr 26, 2022

Hello,

I'm testing a very basic playbook on a ICX 7150 C12 runing 8.0.95d and I'm supprized by the fact changed is always to 1:

---
- hosts: ruckus
  collections:
   - commscope.icx
  connection: network_cli
  gather_facts: no
  vars:
    ansible_become: true
    ansible_become_method: enable
  tasks:
  - name: enable ethernet port 1/1/12
    icx_interface:
        name: ethernet 1/1/12
        enabled: false
        #description: Added by Ansible
  - name: Add a single ethernet 1/1/12 as access(untagged) port to vlan 20
    commscope.icx.icx_vlan:
      name: test-vlan
      vlan_id: 20
      interfaces:
        name:
          - ethernet 1/1/12

Running for the 1st time, config is well applied:

$ ansible-playbook ruckus.yml -v
Using ansible.cfg as config file

PLAY [ruckus] **********************************************************************************************

TASK [enable ethernet port 1/1/12] *************************************************************************
changed: [Ruckus01] => {"changed": true, "commands": ["interface ethernet 1/1/12", "disable"]}

TASK [Add a single ethernet 1/1/12 as access(untagged) port to vlan 20] ************************************
changed: [Ruckus01] => {"changed": true, "commands": ["vlan 20", "vlan 20 name test-vlan", "untagged ethernet 1/1/12", "exit"], "have": [], "output": ["", "", "Port(s) ethe 1/1/12  are already a member of VLAN 20", ""], "want": [{"associated_interfaces": null, "associated_tagged": null, "delay": 10, "interfaces": {"name": ["ethernet 1/1/12"], "purge": null}, "ip_arp_inspection": null, "ip_dhcp_snooping": null, "name": "test-vlan", "state": "present", "tagged": null, "vlan_id": 20}]}

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

But when I'm running it for a 2nd time, changed is still not null, even if the lines are already in the configuration:

$ ansible-playbook ruckus.yml -v
Using ansible.cfg as config file

PLAY [ruckus] **********************************************************************************************

TASK [enable ethernet port 1/1/12] *************************************************************************
changed: [Ruckus01] => {"changed": true, "commands": ["interface ethernet 1/1/12", "disable"]}

TASK [Add a single ethernet 1/1/12 as access(untagged) port to vlan 20] ************************************
changed: [Ruckus01] => {"changed": true, "commands": ["vlan 20", "vlan 20 name test-vlan", "untagged ethernet 1/1/12", "exit"], "have": [], "output": ["", "", "Port(s) ethe 1/1/12  are already a member of VLAN 20", ""], "want": [{"associated_interfaces": null, "associated_tagged": null, "delay": 10, "interfaces": {"name": ["ethernet 1/1/12"], "purge": null}, "ip_arp_inspection": null, "ip_dhcp_snooping": null, "name": "test-vlan", "state": "present", "tagged": null, "vlan_id": 20}]}

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

Am I the only one with this issue? I would expectan "ok=2 changed=0" after the 2nd run, so we can be sure the switch is configured as expected.

Thank you for your help!

Thomas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant