[IR plugin] Ensure auto ssh key exchange in the test host

Tests executed on tripleo setups require ssh key exchange to connect
from the test host to itself

Change-Id: I1862bc2e5269ea6f269e2a17e127957f7d279849
This commit is contained in:
Eduardo Olivares 2022-08-11 12:03:57 +02:00
parent fb0d57e810
commit a1463acdb5
1 changed files with 12 additions and 0 deletions

View File

@ -5,3 +5,15 @@
source {{ stackrc_file }}
openstack quota set --{{ item.key }} {{ item.value }} $OS_PROJECT_NAME
with_dict: "{{ quota | default({}) }}"
- name: ensure auto ssh key exchange in test host
block:
- name: Retrieve public key from private key
command: "ssh-keygen -y -f ~/.ssh/id_rsa"
register: test_host_pubkey_result
- name: insert the public key to the known test host
authorized_key:
user: "{{ ansible_ssh_user }}"
key: "{{ test_host_pubkey_result.stdout }}"
ignore_errors: yes