e4d0325b2f
Don't compare to literal True/False Change-Id: I671978ac95de03d80b059d42f188e9fc9aecb4b4
17 lines
598 B
YAML
17 lines
598 B
YAML
---
|
|
- name: "Defined ssh_private_key_path - Check to see if there is a file where the ssh_private_key_path is defined"
|
|
stat:
|
|
path: "{{ ssh_private_key_path }}"
|
|
register: test_ssh_private_key_path
|
|
delegate_to: localhost
|
|
|
|
- name: "Defined ssh_private_key_path - Error if ssh_private_key_path is not valid"
|
|
fail:
|
|
msg: "ssh_private_key_path is not valid."
|
|
when: not test_ssh_private_key_path.stat.exists
|
|
delegate_to: localhost
|
|
|
|
- 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
|