ansible-dcnm icon indicating copy to clipboard operation
ansible-dcnm copied to clipboard

dcnm_network "replaced" task to remove attachments succeeds but changed flag is set to false.

Open neiljohn-gh opened this issue 7 months ago • 0 comments

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Ansible Version and collection version

ansible [core 2.18.5] collection version 3.8.0

DCNM version

  • V 12.2.2

Affected module(s)

  • dcnm_network

Ansible Playbook

- name: MERGED - Create, Attach Multiple Network with Single Switch Attach
  cisco.dcnm.dcnm_network:
    fabric: "fabric-name"
    state: merged
    config: "{{ conf_with_attachments }}"
  register: result
  tags: replaced

- name: REPLACED - Delete Attachments
  cisco.dcnm.dcnm_network: &conf1
    fabric: "fabric-name"
    state: replaced
    config: "{{ conf_without_attachments }}"
  register: result
  tags: replaced

# below fails
- name: ASSERT - Check if changed flag is true
  assert:
    that:
    - result.changed == true
  tags: replaced

Debug Output

"changed": false,
    "diff": [
        {
            "attach": [
                {
                    "deploy": false,
                    "ip_address": "192.168.x.x",
                    "ports": "Ethernet1/17,Ethernet1/18"
                }
            ],
            "net_name": "net1"
        }    
    ]

Expected Behavior

changed should be true as attachments are removed and diff has correct contents

Actual Behavior

changed is false

Steps to Reproduce

  1. Run a merge task for a network with attachments
  2. Run a replaced task for the same network removing attachments

References

neiljohn-gh avatar Jun 03 '25 06:06 neiljohn-gh