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

[Bug] 'state: absent' does not respect --check mode in module nutanix_vms #534

Open
jong-ntnx opened this issue Dec 11, 2024 · 0 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@jong-ntnx
Copy link

Describe the bug
Using the nutanix.ncp.ntnx_vms module in a play with state: absent should not remove VMs from prism when run in check mode. Today, the module will delete the VMs regardless of whether the --check flag is passed at run time.
This behavior can lead to unintended deletion of VMs during testing.

To Reproduce
sample playbook:

---
- name: Decom Play
  hosts: localhost
  connection: local
  gather_facts: false
  become: false

  vars_files:
    - vars.yml
  tasks:
    - name: Remove VM
      nutanix.ncp.ntnx_vms:
        vm_uuid: '{{ item.uuid }}'
        state: absent
      loop: '{{ decom_targets }}'

ansible-playbook decom.yml --check results in VMs being removed.

Expected behavior
Output in the terminal should indicate which VMs would be removed as part of the play, and the VMs should remain in the same state as before the play was run.

@jong-ntnx jong-ntnx added the bug Something isn't working label Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants