diff --git a/tasks/repo_key_distribute.yml b/tasks/repo_key_distribute.yml index a8f371f..e5c002c 100644 --- a/tasks/repo_key_distribute.yml +++ b/tasks/repo_key_distribute.yml @@ -16,7 +16,7 @@ - name: Create authorized keys file from host vars authorized_key: user: "{{ repo_service_user_name }}" - key: "{{ hostvars[item]['repo_pubkey'] }}" + key: "{{ hostvars[item]['repo_pubkey'] | b64decode }}" with_items: groups['repo_all'] tags: - repo-key diff --git a/tasks/repo_key_populate.yml b/tasks/repo_key_populate.yml index 2036e3f..626f1ca 100644 --- a/tasks/repo_key_populate.yml +++ b/tasks/repo_key_populate.yml @@ -14,8 +14,8 @@ # limitations under the License. - name: Get public key contents and store as var - command: | - cat {{ repo_service_home_folder }}/.ssh/id_rsa.pub + slurp: + src: "{{ repo_service_home_folder }}/.ssh/id_rsa.pub" register: repo_pub changed_when: false tags: @@ -24,7 +24,7 @@ - name: Register a fact for the repo user pub key set_fact: - repo_pubkey: "{{ repo_pub.stdout }}" + repo_pubkey: "{{ repo_pub.content }}" tags: - repo-key - repo-key-create