diff --git a/.gitlab-ci/kubevirt.yml b/.gitlab-ci/kubevirt.yml index c5ac51acc..0f255ddc3 100644 --- a/.gitlab-ci/kubevirt.yml +++ b/.gitlab-ci/kubevirt.yml @@ -4,7 +4,7 @@ interruptible: true script: - ansible-playbook tests/cloud_playbooks/create-kubevirt.yml - -c local -e @"tests/files/${TESTCASE}.yml" + -e @"tests/files/${TESTCASE}.yml" - ./tests/scripts/testcases_run.sh variables: ANSIBLE_TIMEOUT: "120" diff --git a/tests/cloud_playbooks/create-kubevirt.yml b/tests/cloud_playbooks/create-kubevirt.yml index e373cbda2..24dceeb8a 100644 --- a/tests/cloud_playbooks/create-kubevirt.yml +++ b/tests/cloud_playbooks/create-kubevirt.yml @@ -16,9 +16,18 @@ gather_facts: false tasks: + # Check ssh access without relying on python - this is an horrible hack + # but wait_for_connection does not work without python + # and 'until' is incompatible with unreachable errors + # https://github.com/ansible/ansible/issues/78358 - name: Wait until SSH is available - wait_for: - host: "{{ ansible_host }}" - port: 22 - timeout: 240 + command: > + ssh -i "{{ lookup('env', 'ANSIBLE_PRIVATE_KEY_FILE') }}" + -o StrictHostKeyChecking=no + -o UserKnownHostsFile=/dev/null + -o ConnectTimeout=3 "{{ lookup('env', 'ANSIBLE_REMOTE_USER') }}@{{ ansible_host }}" + register: ssh_command + delay: 0 + until: ssh_command.rc != 255 + retries: 60 delegate_to: localhost