Merge "Use discovered private key file"

This commit is contained in:
Zuul 2019-03-29 05:37:50 +00:00 committed by Gerrit Code Review
commit 6635dc6329

View File

@ -473,6 +473,14 @@ outputs:
when: step == '2'
tags: ceph
block:
- name: detect private key file
stat:
path: "{{playbook_dir}}/ssh_private_key"
register: detect_private_key_file
- name: set private key file
set_fact:
ceph_ansible_private_key_file: "{{playbook_dir}}/ssh_private_key"
when: ceph_ansible_private_key_file is not defined and detect_private_key_file.stat.exists
- name: run nodes-uuid
# needs become to be able to read the ssh private key
become: true
@ -484,7 +492,7 @@ outputs:
- ANSIBLE_CONFIG="{{playbook_dir}}/ansible.cfg"
- ANSIBLE_REMOTE_TEMP=/tmp/nodes_uuid_tmp
- ansible-playbook
- '{% if ansible_ssh_private_key_file is defined %}--private-key {{ansible_ssh_private_key_file}}{% endif %}'
- '{% if ceph_ansible_private_key_file is defined %}--private-key {{ceph_ansible_private_key_file}}{% endif %}'
- '-i'
- '{{playbook_dir}}/ceph-ansible/inventory.yml'
- '{% if ansible_python_interpreter is defined %}-e ansible_python_interpreter={{ansible_python_interpreter}}{% endif %}'
@ -576,7 +584,7 @@ outputs:
data: {get_param: CephAnsibleEnvironmentVariables}
expression: $.data.items().select($[0] + '=' + $[1]).join(' ')
- ansible-playbook
- '{% if ansible_ssh_private_key_file is defined %}--private-key {{ansible_ssh_private_key_file}}{% endif %}'
- '{% if ceph_ansible_private_key_file is defined %}--private-key {{ceph_ansible_private_key_file}}{% endif %}'
- '{% if ansible_python_interpreter is defined %}-e ansible_python_interpreter={{ansible_python_interpreter}}{% endif %}'
- '-{%- for number in range(0, ceph_ansible_playbook_verbosity) -%}v{% endfor %}'
- if: