Use slurp to collect the nova ssh keys
Extracting the ssh public key using cat and storing the result in a fact has resulted in periodic failures in the collection of the key, and thereafter the failure to appropriately place that key into the authorised_keys file. This patch changes the collection method to use the Ansible slurp module which has been found to be more reliable. Closes-Bug: #1531783 Change-Id: I26340a0c69064f84d9d87f19ce015ba44b6ffa8b
This commit is contained in:
parent
8a8ad448fe
commit
b4a9dfb10e
@ -16,7 +16,7 @@
|
||||
- name: Create authorized keys file from host vars
|
||||
authorized_key:
|
||||
user: "{{ nova_system_user_name }}"
|
||||
key: "{{ hostvars[item]['nova_pubkey'] }}"
|
||||
key: "{{ hostvars[item]['nova_pubkey'] | b64decode }}"
|
||||
with_items: groups['nova_compute']
|
||||
tags:
|
||||
- nova-key
|
||||
|
@ -25,8 +25,8 @@
|
||||
- nova-key-create
|
||||
|
||||
- name: Get public key contents and store as var
|
||||
command: |
|
||||
cat {{ nova_system_home_folder }}/.ssh/id_rsa.pub
|
||||
slurp:
|
||||
src: "{{ nova_system_home_folder }}/.ssh/id_rsa.pub"
|
||||
register: nova_pub
|
||||
changed_when: false
|
||||
tags:
|
||||
@ -35,7 +35,7 @@
|
||||
|
||||
- name: Register a fact for the nova pub key
|
||||
set_fact:
|
||||
nova_pubkey: "{{ nova_pub.stdout }}"
|
||||
nova_pubkey: "{{ nova_pub.content }}"
|
||||
tags:
|
||||
- nova-key
|
||||
- nova-key-create
|
||||
|
Loading…
Reference in New Issue
Block a user