49 lines
1.7 KiB
YAML
49 lines
1.7 KiB
YAML
---
|
|
# Copyright 2019 Red Hat, Inc.
|
|
# All Rights Reserved.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
# not use this file except in compliance with the License. You may obtain
|
|
# a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
# License for the specific language governing permissions and limitations
|
|
# under the License.
|
|
|
|
- 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: "{{ 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: "{{ 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
|