refactor(cleanup): add configurable verify_boot, boot_timeout, and remove_on_failure defaults
This commit is contained in:
@@ -28,19 +28,21 @@
|
||||
|
||||
- name: Check VM accessibility after reboot
|
||||
when:
|
||||
- cleanup_verify_boot | bool
|
||||
- system_cfg.type == "virtual"
|
||||
- cleanup_post_reboot_can_connect | bool
|
||||
block:
|
||||
- name: Attempt to connect to VM
|
||||
delegate_to: "{{ inventory_hostname }}"
|
||||
ansible.builtin.wait_for_connection:
|
||||
timeout: 300
|
||||
timeout: "{{ cleanup_boot_timeout }}"
|
||||
register: cleanup_vm_connection_check
|
||||
failed_when: false
|
||||
changed_when: false
|
||||
|
||||
- name: VM failed to boot - initiate cleanup
|
||||
when:
|
||||
- cleanup_remove_on_failure | bool
|
||||
- cleanup_vm_connection_check is defined
|
||||
- cleanup_vm_connection_check.failed | bool
|
||||
- virtualization_vm_created_in_run | default(false) | bool
|
||||
|
||||
Reference in New Issue
Block a user