Question

Broken idempotency


Hi,

I've been playing with VX Cumulus 3.7.3 and ansible nclu module. I came across an issue with idempotency while commit knob is set to false.

Sample task:

- name: Configure IPv4 interfaces
nclu:
template: |
{% for interface in interfaces %}
add interface {{interface['name']}} ip address {{interface['ipv4']}}
{% endfor %}
commit: false
notify: "Configuration was changed"


Ansible always marks this task with changed=true regardless of presence of IPv4 configuration. This is because net cli queues up these commands and they are visible in net pending.

TASK [interfaces : Configure IPv4 interfaces] *********************************************************************************************************************************************************
changed: [leaf-sw1] => changed=true
msg: |-
swp1's configuration already has "address 172.16.0.1/31".

swp2's configuration already has "address 172.16.1.1/31".
changed: [spine-sw2] => changed=true
msg: |-
swp1's configuration already has "address 172.16.1.0/31".

swp2's configuration already has "address 172.16.1.2/31".
changed: [spine-sw1] => changed=true
msg: |-
swp1's configuration already has "address 172.16.0.0/31".

swp2's configuration already has "address 172.16.0.2/31".
changed: [leaf-sw2] => changed=true
msg: |-
swp1's configuration already has "address 172.16.0.3/31".

swp2's configuration already has "address 172.16.1.3/31".


Such behavior breaks simple operational model where you want to push all the commands to the box in first place and perform one commit at the end of the playbook (or abort all queued commands).

Is this expected behavior? It breaks the idempotency of NCLU module.

3 replies

Userlevel 4
Thanks for reporting this @piotr.szlenk. Looks like you may have uncovered a bug. Thank me of our engineers is investigating.
Pete B wrote:

Thanks for reporting this @piotr.szlenk. Looks like you may have uncovered a bug. Thank me of our engineers is investigating.



Hey Pete,

If you need access to code that demonstrates it, just let me know.
Userlevel 4
That's really helpful @piotr.szlenk, thank you! I'll let engineering know.

Reply