vmware builds
This commit is contained in:
45
roles/oatakan.rhel_ovirt_template/tasks/stop_vm.yml
Normal file
45
roles/oatakan.rhel_ovirt_template/tasks/stop_vm.yml
Normal file
@@ -0,0 +1,45 @@
|
||||
---
|
||||
|
||||
- block:
|
||||
|
||||
- name: shutdown guest vm
|
||||
ovirt.ovirt.ovirt_vm:
|
||||
auth: "{{ ovirt_auth }}"
|
||||
cluster: "{{ providers.ovirt.cluster }}"
|
||||
name: "{{ template.name }}"
|
||||
state: stopped
|
||||
async: 7200
|
||||
poll: 0
|
||||
register: shutdown
|
||||
when: template is defined
|
||||
|
||||
- name: wait for server to stop responding
|
||||
wait_for:
|
||||
host: "{{ template_vm_ip_address }}"
|
||||
port: "{{ vm_ansible_port | default('22') }}"
|
||||
timeout: 120
|
||||
state: stopped
|
||||
|
||||
- include_tasks: wait_vm_poweredoff_pre29.yml
|
||||
when: ansible_version.full is version('2.9', '<')
|
||||
|
||||
- include_tasks: wait_vm_poweredoff.yml
|
||||
when: ansible_version.full is version('2.9', '>=')
|
||||
|
||||
rescue:
|
||||
- name: ignoring any error
|
||||
debug:
|
||||
msg: "ignoring error..."
|
||||
|
||||
- name: reconfigure vm
|
||||
ovirt.ovirt.ovirt_vm:
|
||||
auth: "{{ ovirt_auth }}"
|
||||
cluster: "{{ providers.ovirt.cluster }}"
|
||||
name: "{{ template.name }}"
|
||||
boot_devices:
|
||||
- hd
|
||||
cd_iso: ""
|
||||
custom_properties: "{{ custom_properties_efi if (template_vm_efi|bool and custom_efi_enabled|bool) else ([{}]) }}"
|
||||
force: yes
|
||||
state: present
|
||||
when: template is defined
|
||||
Reference in New Issue
Block a user