blob: 2dc20aa46f4139eaf1a57de9626ad44508cfbafb (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# Make a playbook usable immediately after creating a VM - even before
# the SSH server is started.
- name: Wait for SSH connection
ansible.builtin.wait_for_connection:
timeout: '{{ cloud_init_wait_seconds }}'
# Again, make a playbook usable immediately after creating a VM - that includes
# waiting until cloud-init is done.
- name: Wait until cloud-init is finished
ansible.builtin.file:
path: '{{ cloud_init_wait_path }}'
state: file
register: boot_finished
until: boot_finished is succeeded
# About 5 minutes worth of attempts.
retries: '{{ cloud_init_wait_seconds // cloud_init_wait_delay }}'
delay: '{{ cloud_init_wait_delay }}'
ignore_unreachable: true
ignore_errors: true
- ansible.builtin.include_tasks: check.yml
when:
- boot_finished is unreachable
|