From 7e55910b27e877574e518fa1febc32405b129171 Mon Sep 17 00:00:00 2001 From: Georg Pfuetzenreuter Date: Mon, 14 Feb 2022 00:32:26 +0100 Subject: Deployment PoC - Add pexpect supervision Signed-off-by: Georg Pfuetzenreuter --- .../deployment_poc/tasks/autoyast_assistant.yml | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 ansible/deployment_poc/tasks/autoyast_assistant.yml (limited to 'ansible/deployment_poc/tasks/autoyast_assistant.yml') diff --git a/ansible/deployment_poc/tasks/autoyast_assistant.yml b/ansible/deployment_poc/tasks/autoyast_assistant.yml new file mode 100644 index 0000000..7a7542a --- /dev/null +++ b/ansible/deployment_poc/tasks/autoyast_assistant.yml @@ -0,0 +1,38 @@ +--- +- name: Monitor OS installation + block: + - name: Monitor first stage + ansible.builtin.expect: + command: "/usr/bin/virsh -c {{ libvirt_url }} console {{ vm_name }} --force" + responses: + "reboot: Restarting system": + - "\u001d" + timeout: 720 + ignore_errors: true + no_log: true + + - name: Destroy + community.libvirt.virt: + uri: "{{ libvirt_url }}" + command: destroy + name: "{{ vm_name }}" + state: destroyed + + - name: Start + community.libvirt.virt: + uri: "{{ libvirt_url }}" + command: start + name: "{{ vm_name }}" + state: running + + - name: Unlock + ansible.builtin.expect: + command: "/usr/bin/virsh -c {{ libvirt_url }} console {{ vm_name }} --force" + responses: + "Please enter passphrase for disk cr_root:": + - "{{ luks_passphrase }}" + - "\u001d" + ignore_errors: yes + no_log: true + + delegate_to: localhost -- cgit v1.2.3