From 85c7ff6989738f87497b5548f4ab9b3ad179e017 Mon Sep 17 00:00:00 2001 From: David Moreau Simard Date: Mon, 26 Feb 2018 10:08:30 -0500 Subject: [PATCH] Fix the copy-build-sshkey role Run the first task in the block, with become_user since the zuul user may not access a generic use .ssh folder. Depends-on: https://review.openstack.org/550091 Change-Id: I4ce120412079fe92502eee5310a03664aa55d5ce --- roles/copy-build-sshkey/tasks/main.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/roles/copy-build-sshkey/tasks/main.yaml b/roles/copy-build-sshkey/tasks/main.yaml index 227d3bccf..c4b12cd7a 100644 --- a/roles/copy-build-sshkey/tasks/main.yaml +++ b/roles/copy-build-sshkey/tasks/main.yaml @@ -1,13 +1,13 @@ --- -# Add the authorization first, to take advantage of manage_dir -- name: Authorize build key - authorized_key: - user: "{{ copy_sshkey_target_user }}" - manage_dir: yes - key: "{{ lookup('file', zuul_temp_ssh_key ~ '.pub') }}" - # Use a block to add become to a set of tasks - block: + # Add the authorization first, to take advantage of manage_dir + - name: Authorize build key + authorized_key: + user: "{{ copy_sshkey_target_user }}" + manage_dir: yes + key: "{{ lookup('file', zuul_temp_ssh_key ~ '.pub') }}" + - name: Install the build private key copy: src: "{{ zuul_temp_ssh_key }}"