Skip to content
Snippets Groups Projects
Commit b87d89aa authored by Mark Goddard's avatar Mark Goddard
Browse files

infra VMs: use wait_for rather than wait_for_connection

wait_for_connection requires a python interpreter to be available, which
may not be the case in some images (CentOS Stream cloud images, cirros
etc.). Instead, use wait_for to wait for the SSH port to open, then rely
on the bootstrapping process to install an interpreter. This is the same
method used for the seed VM.

This change also syncs the SSH wait timeout for infra VMs which the one
used for seed VM provisioning (360 seconds).

Change-Id: I758aff1d3ef714f1c8ef82d29dd2217734a9aae6
parent bf440c5d
No related branches found
No related tags found
No related merge requests found
......@@ -29,17 +29,12 @@
tags:
- infra-vm-provision
tasks:
- name: Wait for a connection to VM with bootstrap user
wait_for_connection:
- name: Wait for SSH access to the infra VM
wait_for:
host: "{{ hostvars[inventory_hostname].ansible_host }}"
port: 22
state: started
# NOTE: Ensure we exceed the 5 minute DHCP timeout of the eth0
# interface if necessary.
timeout: 600
vars:
# NOTE(wszumski): ansible_host_key_checking variable doesn't seem to
# work, But it would be nice not to fail if the host_key changes.
# We check the hostkey during host configure.
# https://github.com/ansible/ansible/blob/1c34492413dec09711c430745034db0c108227a9/lib/ansible/plugins/connection/ssh.py#L49
# https://github.com/ansible/ansible/issues/49254
ansible_ssh_extra_args: '{{ infra_vm_wait_connection_ssh_extra_args }}'
ansible_user: "{{ bootstrap_user }}"
ansible_python_interpreter: /usr/bin/python3
timeout: 360
delegate_to: localhost
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment