Merge "Make ceph-ansible run handle missing "{{ playbook_dir }}/ssh_key""

This commit is contained in:
Zuul 2020-03-26 13:48:43 +00:00 committed by Gerrit Code Review
commit 7ec3a7115b
2 changed files with 22 additions and 4 deletions

View File

@ -19,7 +19,7 @@
nodes_uuid_list:
- ANSIBLE_LOG_PATH="{{ playbook_dir }}/ceph-ansible/nodes_uuid_command.log"
- ANSIBLE_SSH_CONTROL_PATH_DIR="{{ playbook_dir }}/ceph-ansible/"
- ANSIBLE_CONFIG="{{ playbook_dir }}/ansible.cfg"
- ANSIBLE_CONFIG=/usr/share/ceph-ansible/ansible.cfg
- ANSIBLE_REMOTE_TEMP=/tmp/nodes_uuid_tmp
- "{{ calling_ansible_environment_variables|join(' ') }}"
- "{{ ceph_ansible_environment_variables|join(' ') }}"

View File

@ -14,17 +14,35 @@
# License for the specific language governing permissions and limitations
# under the License.
- name: detect private key file
- name: detect private key file in $HOME/.ssh/id_rsa_tripleo
# needs become to be able to read the ssh private key
become: true
stat:
path: "{{ playbook_dir }}/ssh_private_key"
path: "{{ lookup('env','HOME') }}/.ssh/id_rsa_tripleo"
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"
ceph_ansible_private_key_file: "{{ lookup('env','HOME') }}/.ssh/id_rsa_tripleo"
when:
- detect_private_key_file.stat.exists | bool
- name: Falling back to looking for ssh_private_key in playbook_dir
when: ceph_ansible_private_key_file is undefined
block:
- name: detect private key file in playbook_dir
# 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:
- detect_private_key_file.stat.exists | bool