diff --git a/roles/add-build-sshkey/tasks/create-key-and-replace.yaml b/roles/add-build-sshkey/tasks/create-key-and-replace.yaml index 87ddbbe72..e26ceaa2f 100644 --- a/roles/add-build-sshkey/tasks/create-key-and-replace.yaml +++ b/roles/add-build-sshkey/tasks/create-key-and-replace.yaml @@ -1,6 +1,7 @@ - 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: @@ -11,10 +12,12 @@ - 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: diff --git a/roles/add-build-sshkey/tasks/main.yaml b/roles/add-build-sshkey/tasks/main.yaml index 7b3ab38e4..52a053d93 100644 --- a/roles/add-build-sshkey/tasks/main.yaml +++ b/roles/add-build-sshkey/tasks/main.yaml @@ -3,6 +3,7 @@ path: "{{ zuul_temp_ssh_key }}" register: zuul_temp_ssh_key_stat delegate_to: localhost + run_once: true failed_when: false - name: Create a new key in workspace based on build UUID