Make sure authorized_keys is not altered during a job

Change-Id: I5086fc7004c24813e4dae5a4c12037f237502d27
This commit is contained in:
Albin Vass 2020-05-15 20:46:12 +02:00
parent a9f6ab15e3
commit d0a2a2e398
2 changed files with 10 additions and 0 deletions

View File

@ -1,3 +1,8 @@
- hosts: all
roles:
- remove-build-sshkey
tasks:
- name: Reinstall saved authorized_keys
copy:
src: "{{ zuul.executor.work_root }}/{{ inventory_hostname }}_authorized_keys"
dest: "{{ ansible_user_dir }}/.ssh/authorized_keys"

View File

@ -1,4 +1,9 @@
- hosts: all
pre_tasks:
- name: Save authorized_keys
fetch:
src: "{{ ansible_user_dir }}/.ssh/authorized_keys"
dest: "{{ zuul.executor.work_root }}/{{ inventory_hostname }}_authorized_keys"
roles:
- add-build-sshkey
- prepare-workspace