b214e276ec
Some tasks, such as proposal tasks, need to make outbound ssh connections via non-ansible means. Add a role that takes a secret and writes out a private key and optionally a known hosts entry. Change-Id: I569b93ba0e775896b5a4f59b544fe32d1e2dce9b
11 lines
312 B
YAML
11 lines
312 B
YAML
- name: Write out ssh key
|
|
file:
|
|
path: "~/.ssh/id_rsa"
|
|
content: "{{ ssh_key.ssh_private_key }}"
|
|
|
|
- name: Add host key information to known hosts
|
|
known_hosts:
|
|
name: "{{ ssh_key.fqdn }}"
|
|
key: "{{ ssh_key.ssh_known_hosts }}"
|
|
when: ssh_key.ssh_known_hosts is defined and ssh_key.fqdn is defined
|