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

vmware_guest, cdrom state: absent does not work #1963

Open
fs30000 opened this issue Jan 9, 2024 · 0 comments
Open

vmware_guest, cdrom state: absent does not work #1963

fs30000 opened this issue Jan 9, 2024 · 0 comments

Comments

@fs30000
Copy link

fs30000 commented Jan 9, 2024

SUMMARY

On the module vmware_guest, using state: absent on the cdrom sub-module does not work. In fact, if there is no cdrom on the VM it does precisely the opposite, it adds one to the VM!

ISSUE TYPE
  • Bug Report
COMPONENT NAME

vmware_guest

ANSIBLE VERSION
ansible [core 2.14.3]
  config file = /playbooks/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0] (/usr/bin/python3)
  jinja version = 3.1.2
  libyaml = True


COLLECTION VERSION
ansible-galaxy collection list community.general

# /usr/lib/python3/dist-packages/ansible_collections
Collection        Version
----------------- -------
community.general 6.4.0


ansible-galaxy collection list  |grep vmware
community.vmware              3.4.0
vmware.vmware_rest            2.2.0
community.vmware 3.11.1

OS / ENVIRONMENT

Debian 12
Vcenter 7.0.3

STEPS TO REPRODUCE
    - name: Remove cdrom/iso
      community.vmware.vmware_guest:
        hostname: "{{ vcenter_host }}"
        username: "{{ vcenter_username }}"
        password: "{{ vcenter_password }}"
        datacenter: "{{ vcenter_datacenter }}"
        validate_certs: false
        name: "{{ template_servers.hostname }}"
        cdrom:
          type: iso
          iso_path: '{{ iso }}'
          state: "absent"

This even adds the cdrom!

Using type: none, does not remove it as well. With just cdrom: and state: absent, it fails and asks for type.
EXPECTED RESULTS

To remove the cdrom.

ACTUAL RESULTS

Does not remove the cdrom, it even adds it.

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