refactor(cleanup): add configurable verify_boot, boot_timeout, and remove_on_failure defaults

This commit is contained in:
2026-02-20 23:02:24 +01:00
parent 14913bcd3d
commit 07492b5b57
2 changed files with 9 additions and 1 deletions

View File

@@ -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