CiscoDevNet / ansible-mso

Cisco MSO Ansible Collection
https://galaxy.ansible.com/cisco/mso
GNU General Public License v3.0
26 stars 32 forks source link

Update query on uuid, on all the existing NDO modules (DCNE-184) #537

Open anvitha-jain opened 2 months ago

anvitha-jain commented 2 months ago

Community Note

Description

Affected Module Name(s):

MSO version and MSO Platform

APIC version and APIC Platform for Site Level Resources

Collection versions

Output/ Error message

*

Expected Behavior

*

Actual Behavior

*

Playbook tasks to Reproduce

*

Important Factoids

References

akinross commented 2 months ago

Should we update this issue to not limit the scope to query only, but then also support present/absent scenarios.

I think if we change below only we can also support the update and delete scenarios. Should we add this to do full uuid support?

        required_if=[
            ["state", "present", ["a", "a_uuid"], True],
            ["state", "absent", ["a", "a_uuid"], True],
if a or a_uuid:
     -  ....lookup_logic

I think with this logic you should be able to do the lookup properly and then the create/delete can be done or the change of attributes can all stay the same once there is a match. We would then only need to decide and double check that we always error when UUID is not found for present scenario.