summaryrefslogtreecommitdiffstats
path: root/ansible/deployment_poc/tasks/wait.yml
blob: 4553a7678d7ea74730df85a3144ae4438deb2efe (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
39
40
41
42
---
- 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

  delegate_to: localhost
  tags:
    - init_ssh