diff --git a/linux/deploy_vm/collect_vm_logs.yml b/linux/deploy_vm/collect_vm_logs.yml index 85be13fa2..dd8e6461a 100644 --- a/linux/deploy_vm/collect_vm_logs.yml +++ b/linux/deploy_vm/collect_vm_logs.yml @@ -5,11 +5,17 @@ # cloud image, VMware Photon OS OVA or Amazon Linux OVA. # - name: "Collect VM deployement logs" + when: + - vm_exists is defined + - vm_exists block: - name: "Get VM's power state" include_tasks: ../../common/vm_get_power_state.yml - name: "Collect VM's guest info and cloud-init logs" + when: + - vm_power_state_get is defined + - vm_power_state_get == "poweredOn" block: - name: "Get VMware Tools status" include_tasks: ../../common/vm_get_vmtools_status.yml @@ -32,9 +38,3 @@ unattend_install_conf is match('Ubuntu/Desktop/Subiquity'))) or (ova_guest_os_type is defined and ova_guest_os_type in ['photon', 'ubuntu', 'amazon'])) - when: - - vm_power_state_get is defined - - vm_power_state_get == "poweredOn" - when: - - vm_exists is defined - - vm_exists diff --git a/linux/deploy_vm/deploy_vm_from_iso.yml b/linux/deploy_vm/deploy_vm_from_iso.yml index e2b09064d..2e9dfd9fa 100644 --- a/linux/deploy_vm/deploy_vm_from_iso.yml +++ b/linux/deploy_vm/deploy_vm_from_iso.yml @@ -250,7 +250,6 @@ - name: "Remove serial port" include_tasks: ../../common/vm_remove_serial_port.yml - - name: "OS auto install is completed. Power on VM now" include_tasks: ../../common/vm_set_power_state.yml vars: diff --git a/linux/deploy_vm/flatcar/generate_ignition_config.yml b/linux/deploy_vm/generate_ignition_config.yml similarity index 96% rename from linux/deploy_vm/flatcar/generate_ignition_config.yml rename to linux/deploy_vm/generate_ignition_config.yml index 61ce10cc2..045cb1753 100644 --- a/linux/deploy_vm/flatcar/generate_ignition_config.yml +++ b/linux/deploy_vm/generate_ignition_config.yml @@ -13,7 +13,7 @@ # Put SSH public key into ignition config file - name: "Generation Ignition config file {{ ignition_config_file }}" ansible.builtin.template: - src: ignition_config.j2 + src: "templates/ignition_config.j2" dest: "{{ ignition_config_file }}" mode: "0644" register: generate_ignition diff --git a/linux/deploy_vm/reconfigure_vm_with_ignition.yml b/linux/deploy_vm/reconfigure_vm_with_ignition.yml index 05089c5a2..07c393e97 100644 --- a/linux/deploy_vm/reconfigure_vm_with_ignition.yml +++ b/linux/deploy_vm/reconfigure_vm_with_ignition.yml @@ -4,7 +4,7 @@ # Use Ignition to configure guest OS username, password, SSH authorized keys, etc # - name: "Generate Ignition config file" - include_tasks: flatcar/generate_ignition_config.yml + include_tasks: generate_ignition_config.yml - name: "Define Ignition configs in VM guestinfo" include_tasks: ../../common/vm_set_extra_config.yml diff --git a/linux/deploy_vm/flatcar/ignition_config.j2 b/linux/deploy_vm/templates/ignition_config.j2 similarity index 100% rename from linux/deploy_vm/flatcar/ignition_config.j2 rename to linux/deploy_vm/templates/ignition_config.j2