Add SSH key to execturo

Change-Id: I7e39a1c7e46312346f73d17711f552c8e10f9301
This commit is contained in:
Mohammed Naser 2022-04-29 23:15:47 -04:00
parent 0c8f31d6c5
commit b1b03f0dc0

View File

@ -33,6 +33,21 @@
src: "{{ ansible_user_dir }}/.cache/molecule/{{ zuul.project.short_name }}/default/instance_config.yml"
register: _molecule_instance_config
- name: Grab the Molecule SSH key
slurp:
src: "{{ ansible_user_dir }}/.cache/molecule/{{ zuul.project.short_name }}/default/id_rsa"
register: _molecule_ssh_key
- name: Copy the SSH key down to exector
fetch:
src: "{{ ansible_user_dir }}/.cache/molecule/{{ zuul.project.short_name }}/default/id_rsa"
dest: "{{ ansible_user_dir }}/.ssh/id_molecule"
flat: yes
- name: Add SSH key to the executor
delegate_to: localhost
command: ssh-add {{ ansible_user_dir }}/.ssh/id_molecule
- name: Add all of the hosts to the inventory
add_host:
name: "{{ item.instance }}"