mirror of
https://github.com/kubevirt/kubevirt.core.git
synced 2026-07-31 20:04:37 +00:00
fix(tests,kubevirt_vm): Make waiting for VM more robust
This changes the runme.sh of the kubevirt_vm integration tests to retry the connection to the VM until a login is possible. This is necessary since it is not possible with Ansible alone to retry a task in case the connection failed with the unreachable status. This can happen when the sshd of the VM already accepts connections but a login is not yet possible because the VM is still booting up. Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
This commit is contained in:
@@ -1,27 +1,4 @@
|
||||
---
|
||||
- name: Wait for SSH
|
||||
connection: local
|
||||
gather_facts: false
|
||||
hosts: localhost
|
||||
tasks:
|
||||
- name: Wait up to 900 seconds for port 22 to become open
|
||||
ansible.builtin.wait_for:
|
||||
port: 22
|
||||
host: "{{ hostvars['default-testvm'].ansible_host }}"
|
||||
delay: 30
|
||||
timeout: 900
|
||||
|
||||
- name: Connect to VM
|
||||
gather_facts: true
|
||||
hosts: default-testvm
|
||||
remote_user: cloud-user
|
||||
vars:
|
||||
ansible_python_interpreter: /usr/bin/python3
|
||||
tasks:
|
||||
- name: Print VM facts
|
||||
ansible.builtin.debug:
|
||||
var: ansible_facts
|
||||
|
||||
- name: Verify creation with existing VM
|
||||
connection: local
|
||||
gather_facts: false
|
||||
|
||||
Reference in New Issue
Block a user