2022-02-13 01:37:39 +01:00
|
|
|
---
|
2022-02-14 00:32:26 +01:00
|
|
|
- name: Sit patiently
|
|
|
|
block:
|
|
|
|
- name: Wait for guest to become alive
|
|
|
|
wait_for:
|
|
|
|
delay: 240
|
|
|
|
connect_timeout: 3
|
|
|
|
sleep: 15
|
|
|
|
port: 22
|
|
|
|
host: '{{ ip_address }}'
|
|
|
|
search_regex: OpenSSH
|
|
|
|
timeout: 600
|
|
|
|
|
|
|
|
# rescue:
|
|
|
|
# - 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: Wait for guest to become alive
|
|
|
|
# wait_for:
|
|
|
|
# delay: 120
|
|
|
|
# connect_timeout: 3
|
|
|
|
# sleep: 15
|
|
|
|
# port: 22
|
|
|
|
# host: '{{ ip_address }}'
|
|
|
|
# search_regex: OpenSSH
|
|
|
|
# timeout: 600
|
|
|
|
|
2022-02-13 16:56:12 +01:00
|
|
|
delegate_to: localhost
|
|
|
|
tags:
|
|
|
|
- init_ssh
|
2022-02-14 00:32:26 +01:00
|
|
|
|