Add known_hosts support

Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
Paul Belanger 2015-12-08 13:43:13 -05:00
parent 26544ee4b3
commit 429935d063
2 changed files with 12 additions and 0 deletions

View File

@ -21,3 +21,6 @@ ssh_key_private_filename: id_rsa
ssh_key_public_content:
ssh_key_public_filename: id_rsa.pub
ssh_known_hosts_content:
ssh_known_hosts_filename: known_hosts

View File

@ -20,6 +20,15 @@
owner: "{{ ssh_user_name }}"
state: directory
- name: Create ssh known_hosts file.
copy:
content: "{{ ssh_known_hosts_content }}"
dest: "{{ ssh_user_home }}/.ssh/{{ ssh_known_hosts_filename }}"
group: "{{ ssh_user_group }}"
mode: 0644
owner: "{{ ssh_user_name }}"
when: ssh_known_hosts_content
- name: Create ssh private key.
copy:
content: "{{ ssh_key_private_content }}"