CiscoDevNet / ansible-aci

Cisco ACI Ansible Collection
https://galaxy.ansible.com/cisco/aci
GNU General Public License v3.0
132 stars 91 forks source link

BGP type L3out always reports a change #631

Closed edudppaz closed 2 months ago

edudppaz commented 3 months ago

Community Note

Description

When configuring a L3out cisco.aci.aci_l3out of type BGP, the subsequent runs always show a change on the l3out even though nothing is being changed. It seems like this is due to the eigrpExtP, ospfExtP and pimExtP always being marked as "deleted" on the Ansible invocation side.

Affected Module Name(s):

APIC version and APIC Platform

Collection versions

Output/ Error message

changed: [localhost] => (item=CML-l3out-to-external-router-1) => {
    "ansible_loop_var": "item",
    "changed": true,
    "current": [
        {
            "l3extOut": {
                "attributes": {
                    "annotation": "orchestrator:ansible",
                    "descr": "",
                    "dn": "uni/tn-CML/out-l3out-to-external-router-1",
                    "enforceRtctrl": "export",
                    "mplsEnabled": "no",
                    "name": "l3out-to-external-router-1",
                    "nameAlias": "",
                    "ownerKey": "",
                    "ownerTag": "",
                    "targetDscp": "unspecified",
                    "userdom": ":all:"
                },
                "children": [
                    {
                        "l3extRsL3DomAtt": {
                            "attributes": {
                                "annotation": "",
                                "tDn": "uni/l3dom-ROUTED1",
                                "userdom": ":all:"
                            }
                        }
                    },
                    {
                        "l3extRsEctx": {
                            "attributes": {
                                "annotation": "",
                                "tnFvCtxName": "prod.prod-vrf",
                                "userdom": "all"
                            }
                        }
                    },
                    {
                        "bgpExtP": {
                            "attributes": {
                                "annotation": "",
                                "descr": "",
                                "nameAlias": "",
                                "userdom": ":all:"
                            }
                        }
                    }
                ]
            }
        }
    ],
    "invocation": {
        "module_args": {
            "annotation": "orchestrator:ansible",
            "asn": null,
            "certificate_name": "ACIAdmin",
            "description": "",
            "domain": "ROUTED1",
            "dscp": null,
            "host": "10.1.241.36",
            "l3out": "l3out-to-external-router-1",
            "l3protocol": [
                "bgp"
            ],
            "mpls": null,
            "name": "l3out-to-external-router-1",
            "name_alias": null,
            "ospf": null,
            "output_level": "normal",
            "output_path": null,
            "owner_key": null,
            "owner_tag": null,
            "password": null,
            "port": null,
            "private_key": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "protocol": "https",
            "route_control": [
                "export"
            ],
            "state": "present",
            "tenant": "CML",
            "timeout": null,
            "use_proxy": null,
            "use_ssl": null,
            "username": "admin",
            "validate_certs": false,
            "vrf": "prod.prod-vrf"
        }
    },
    "item": {
        "tenant_l3outs_domain": "ROUTED1",
        "tenant_l3outs_name": "l3out-to-external-router-1",
        "tenant_l3outs_protocol": "bgp",
        "tenant_l3outs_vrf": "prod.prod-vrf",
        "tenant_name": "CML"
    },
    "mo": {
        "l3extOut": {
            "attributes": {
                "annotation": "orchestrator:ansible",
                "descr": "",
                "dn": "uni/tn-CML/out-l3out-to-external-router-1",
                "enforceRtctrl": "export",
                "name": "l3out-to-external-router-1"
            },
            "children": [
                {
                    "l3extRsL3DomAtt": {
                        "attributes": {
                            "tDn": "uni/l3dom-ROUTED1"
                        }
                    }
                },
                {
                    "l3extRsEctx": {
                        "attributes": {
                            "tnFvCtxName": "prod.prod-vrf"
                        }
                    }
                },
                {
                    "bgpExtP": {
                        "attributes": {
                            "descr": ""
                        }
                    }
                },
                {
                    "eigrpExtP": {
                        "attributes": {
                            "status": "deleted"
                        }
                    }
                },
                {
                    "ospfExtP": {
                        "attributes": {
                            "status": "deleted"
                        }
                    }
                },
                {
                    "pimExtP": {
                        "attributes": {
                            "status": "deleted"
                        }
                    }
                }
            ]
        }
    }
}

Expected Behavior

No change is reported for the l3out

Actual Behavior

Change is always reported for l3out

Playbook tasks to Reproduce

Run playbook with (example):

    - name: Add L3 Outs to tenant
      cisco.aci.aci_l3out:
        <<: *aci_info
        tenant: "{{ item.tenant_name }}"
        name: "{{ item.tenant_l3outs_name }}"
        description: "{{ item.tenant_l3outs_description|default('') }}"
        domain: "{{ item.tenant_l3outs_domain }}"
        vrf: "{{ item.tenant_l3outs_vrf }}"
        l3protocol: ["{{ item.tenant_l3outs_protocol }}"]
        route_control: "export"
        state: present
      loop: "{{ aci_tenants|aci_listify('tenant', 'l3outs') }}"
      loop_control:
        label: "{{ item.tenant_name }}-{{ item.tenant_l3outs_name }}"

Data:

---
  aci_tenants:
    tenant:
      - name: CML
        l3outs:
          - name: l3out-to-external-router-1
            vrf: prod.prod-vrf
            domain: ROUTED1
            protocol: bgp

Important Factoids

References

akinross commented 3 months ago

Hi @edudppaz, I believe this has already been fixed in this commit: https://github.com/CiscoDevNet/ansible-aci/commit/f3c95ef2a990686539d51039c1cffd025259a3f4 in PR https://github.com/CiscoDevNet/ansible-aci/pull/542. We will need to release a new version of the collection. I will reach out internally for the schedule to release.

edudppaz commented 2 months ago

Great, thanks :) will wait out for the new version

akinross commented 2 months ago

@edudppaz, new version (v2.9.0) was released 4 days ago. Please let me know if there are any issues.

edudppaz commented 2 months ago

Thanks , had to force the upgrade :P . just tested, the l3-out change is gone! Im closing this issue then.