bifrost/playbooks/roles/bifrost-ironic-install/tasks/set_ssh_private_key.yml
Andrey Shestakov 5be9b6fa7a Allow user to specify private SSH key
This change allows insert user specified private ssh key for ironic.
This is required for ansible deploy driver, and can be useful for
another ssh based drivers.

Change-Id: I203963c9aefa55e9c88f2a37e43b3ef440d02e23
2017-01-16 17:20:46 +02:00

13 lines
567 B
YAML

---
- name: "Defined ssh_private_key_path - Check to see if there is a file where the ssh_private_key_path is defined"
local_action: stat path={{ ssh_private_key_path }}
register: test_ssh_private_key_path
- name: "Defined ssh_private_key_path - Error if ssh_private_key_path is not valid"
local_action: fail msg="ssh_private_key_path is not valid."
when: test_ssh_private_key_path.stat.exists == false
- name: "Defined ssh_private_key_path - Read SSH private key in"
set_fact: ssh_private_key="{{ lookup('file', ssh_private_key_path ) }}"
no_log: true