Created
September 24, 2020 15:35
-
-
Save goneri/6afd05397390cf5a0976f3611814949a to your computer and use it in GitHub Desktop.
vmware_rest.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Collect the list of the existing VM | |
vcenter_vm_info: | |
register: existing_vms | |
until: existing_vms is not failed | |
- name: Turn off the VM | |
vcenter_vm_power: | |
state: stop | |
vm: '{{ item.vm }}' | |
with_items: "{{ existing_vms.value }}" | |
ignore_errors: yes | |
- name: Delete some VM | |
vcenter_vm: | |
state: absent | |
vm: '{{ item.vm }}' | |
with_items: "{{ existing_vms.value }}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment