Open samurato opened 2 years ago
@samurato mark-delete will only mark the policy as deleted so the next recalculation of the entire configuration of the switch will generate "no xxxx" to remove the configuration from the switch.
NDFC can't just simply delete the command in policy by appending no
in the front, your example is simple as there is no context. Let's take a look below example if you configure a bgp neighbor:
router bgp 65001
neighbor 192.10.0.1
remote-as 65001
NDFC can't just add no command on each line of the config as it will be valid:
neighbor 192.10.0.1
will also remove and context under it, so no remote-as 65001
will be an invalid command lineIn a nutshell, in order to remove the configuration that is deployed from policy, NDFC has to recalculate the entire configuration of the given switch and deploy it. The behavior of the module is expected.
Community Note
Ansible Version and collection version
DCNM version
Affected module(s)
Ansible Playbook
Debug Output
Expected Behavior
This should only push the policy that we are targeting all the policies that has been in pending. Example in the Gui Rest API tool A put request is sent when I delete a policy
Actual Behavior
This playbook is marking a policy to be deleted and dpeloying all the pending configs. So all the configs that are staged (not deployed) will also be deployed. This behavious is due to two rest call being made
Steps to Reproduce
Setup 2-3 policies via GUI but do not deploy them. Use the playbook and try to delete one policy. We can see the fabric goes in sync due to the
This should not happen as other policies are not supposed to be touched by this module as we are targeting per policy
References
I think by invoking just the rest call below we can achieve https://github.com/CiscoDevNet/ansible-dcnm/issues/164 However, this needs to be tested
https://github.com/CiscoDevNet/ansible-dcnm/issues/163 :- This bug blast radius has narrowed down to switch as opposed to fabric level. Also, I have replaced my values with dummy values for config data.