
In a multi node setup, we only want this logic to be run one across all hosts. Change-Id: I4ebb62f76d4ff7363635bee7073c2d7e8f0ad70e Signed-off-by: Paul Belanger <pabelanger@redhat.com>
24 lines
580 B
YAML
24 lines
580 B
YAML
- name: Create Temp SSH key
|
|
command: ssh-keygen -t rsa -b 1024 -N '' -f {{ zuul_temp_ssh_key }}
|
|
delegate_to: localhost
|
|
run_once: true
|
|
|
|
- name: Distribute it to all nodes
|
|
authorized_key:
|
|
user: "{{ ansible_ssh_user }}"
|
|
state: present
|
|
key: "{{ lookup('file', zuul_temp_ssh_key + '.pub') }}"
|
|
|
|
- name: Remove all keys from local agent
|
|
command: ssh-add -D
|
|
delegate_to: localhost
|
|
run_once: true
|
|
|
|
- name: Add back temp key
|
|
command: ssh-add {{ zuul_temp_ssh_key }}
|
|
delegate_to: localhost
|
|
run_once: true
|
|
|
|
- name: Verify we can still SSH to all nodes
|
|
ping:
|