Use slurp to collect the swift 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: #1506291 Change-Id: I3ba5cdc944f38c67762860dc0d06bd5c35eeb269
This commit is contained in:
parent
3a53450adc
commit
d954d599bd
@ -16,7 +16,7 @@
|
||||
- name: Create authorized keys file from host vars
|
||||
authorized_key:
|
||||
user: "{{ swift_system_user_name }}"
|
||||
key: "{{ hostvars[item]['swift_pubkey'] }}"
|
||||
key: "{{ hostvars[item]['swift_pubkey'] | b64decode }}"
|
||||
with_items: groups['swift_all'] + groups['swift_remote_all']
|
||||
tags:
|
||||
- swift-key
|
||||
|
@ -14,8 +14,8 @@
|
||||
# limitations under the License.
|
||||
|
||||
- name: Get public key contents and store as var
|
||||
command: |
|
||||
cat {{ swift_system_home_folder }}/.ssh/id_rsa.pub
|
||||
slurp:
|
||||
src: "{{ swift_system_home_folder }}/.ssh/id_rsa.pub"
|
||||
register: swift_pub
|
||||
changed_when: false
|
||||
tags:
|
||||
@ -24,7 +24,7 @@
|
||||
|
||||
- name: Register a fact for the swift pub key
|
||||
set_fact:
|
||||
swift_pubkey: "{{ swift_pub.stdout }}"
|
||||
swift_pubkey: "{{ swift_pub.content }}"
|
||||
tags:
|
||||
- swift-key
|
||||
- swift-key-create
|
||||
|
Loading…
x
Reference in New Issue
Block a user