summaryrefslogtreecommitdiffstats
path: root/ansible/deployment_poc/tasks/autoyast_assistant.yml
blob: 7a7542a4f324b0ff79ea1d4755529f11c96618de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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