Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When user creates an object with some parameters and then tries to delete the same object wth just a mandary parameter, the object does not get deleted #31

Open
tanmayx opened this issue Jun 29, 2017 · 0 comments

Comments

@tanmayx
Copy link

tanmayx commented Jun 29, 2017

Create a boot policy with some parameter values (which are not default values) -

- name: boot policy create
      cisco_ucs_boot_policy:
        name: boot_policy2
        reboot_on_update: yes
        enforce_vnic_name: no
        boot_mode: uefi
        state: present
        ucs_ip: "{{ ucs_ip }}"
        ucs_username: "{{ ucs_username }}"
        ucs_password: "{{ ucs_password }}"

Now delete the boot policy by passing just the mandatory param ie name -

- name: boot policy delete
      cisco_ucs_boot_policy:
        name: boot_policy2
        state: absent
        ucs_ip: "{{ ucs_ip }}"
        ucs_username: "{{ ucs_username }}"
        ucs_password: "{{ ucs_password }}"

In this case, the policy is not deleted.
This happens because the ansible module checks for the object existence with the default values and since the object was created with different values, the object exists returns false and hence the object is not deleted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant