Forces root for get_ssh_private_key

The ssh private key is not created by the external tasks so we
need to use become: true to make sure external tasks have read
permissions on the file.

Change-Id: Ic88ccee05c5a286763661e8cc97e75b13dedba7e
Related-Bug: 1823229
This commit is contained in:
Giulio Fidente 2020-03-06 14:36:11 +01:00
parent be80cd7ac6
commit ccc8fb2e48
1 changed files with 4 additions and 0 deletions

View File

@ -15,11 +15,15 @@
# under the License.
- name: detect private key file
# needs become to be able to read the ssh private key
become: true
stat:
path: "{{ playbook_dir }}/ssh_private_key"
register: detect_private_key_file
- name: set private key file
# needs become to be able to read the ssh private key
become: true
set_fact:
ceph_ansible_private_key_file: "{{ playbook_dir }}/ssh_private_key"
when: