diff --git a/tripleo_ansible/roles/tripleo_ceph_uuid/tasks/gather.yml b/tripleo_ansible/roles/tripleo_ceph_uuid/tasks/gather.yml index 97d3b70a4..bdcb3d01f 100644 --- a/tripleo_ansible/roles/tripleo_ceph_uuid/tasks/gather.yml +++ b/tripleo_ansible/roles/tripleo_ceph_uuid/tasks/gather.yml @@ -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(' ') }}" diff --git a/tripleo_ansible/roles/tripleo_ceph_work_dir/tasks/get_ssh_private_key.yml b/tripleo_ansible/roles/tripleo_ceph_work_dir/tasks/get_ssh_private_key.yml index 0dcb4f869..4b58cc8c2 100644 --- a/tripleo_ansible/roles/tripleo_ceph_work_dir/tasks/get_ssh_private_key.yml +++ b/tripleo_ansible/roles/tripleo_ceph_work_dir/tasks/get_ssh_private_key.yml @@ -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