Merge "Make ceph-ansible run handle missing "{{ playbook_dir }}/ssh_key""
This commit is contained in:
commit
7ec3a7115b
|
@ -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(' ') }}"
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue