Skip to content

Commit 968a3ba

Browse files
committed
Replace vmware.vmware_rest.vcenter_vm
1 parent 2d1cdb9 commit 968a3ba

File tree

2 files changed

+21
-12
lines changed

2 files changed

+21
-12
lines changed

tests/integration/targets/prepare_vmware_tests/tasks/teardown_with_esxi.yml

+10-6
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
register: existing_vms
1212
until: existing_vms is not failed
1313

14+
- name: Debug existing VMs
15+
debug:
16+
var: existing_vms
17+
1418
- name: Turn off the VM
1519
vmware.vmware.vm_powerstate:
1620
hostname: '{{ vcenter_hostname }}'
@@ -23,14 +27,14 @@
2327
ignore_errors: true
2428

2529
- name: Delete the VMs
26-
vmware.vmware_rest.vcenter_vm:
27-
vcenter_hostname: '{{ vcenter_hostname }}'
28-
vcenter_username: '{{ vcenter_username }}'
29-
vcenter_password: '{{ vcenter_password }}'
30-
vcenter_validate_certs: false
30+
community.vmware.vmware_guest:
31+
hostname: '{{ vcenter_hostname }}'
32+
username: '{{ vcenter_username }}'
33+
password: '{{ vcenter_password }}'
34+
validate_certs: false
3135
state: absent
3236
vm: '{{ item.vm }}'
33-
with_items: "{{ existing_vms.value }}"
37+
with_items: "{{ existing_vms.guests }}"
3438
when:
3539
- not item.name.startswith("vCLS")
3640

tests/integration/targets/vmware_guest/tasks/run_test_playbook.yml

+11-6
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212
- _moId
1313
register: existing_vms
1414
until: existing_vms is not failed
15+
16+
- name: Debug existing VMs
17+
debug:
18+
var: existing_vms
19+
1520
- name: Turn off the VM
1621
vmware.vmware.vm_powerstate:
1722
hostname: '{{ vcenter_hostname }}'
@@ -23,13 +28,13 @@
2328
with_items: "{{ existing_vms.guests }}"
2429
ignore_errors: true
2530
- name: Clean up VM
26-
vmware.vmware_rest.vcenter_vm:
27-
vcenter_hostname: '{{ vcenter_hostname }}'
28-
vcenter_username: '{{ vcenter_username }}'
29-
vcenter_password: '{{ vcenter_password }}'
30-
vcenter_validate_certs: false
31+
community.vmware.vmware_guest:
32+
hostname: '{{ vcenter_hostname }}'
33+
username: '{{ vcenter_username }}'
34+
password: '{{ vcenter_password }}'
35+
validate_certs: false
3136
state: absent
3237
vm: '{{ item.vm }}'
33-
with_items: "{{ existing_vms.value }}"
38+
with_items: "{{ existing_vms.guests }}"
3439
when:
3540
- not item.name.startswith("vCLS")

0 commit comments

Comments
 (0)