Add tripleo-ssh-known-hosts role

Support the SshKnownHostsDeployment resources from Heat with a new
Ansible role in tripleo-common for use by config-download. The new role
will configure /etc/ssh/ssh_known_hosts in the same manner that the Heat
deployments did.

Change-Id: I9314596f9ab48e95ba34d08dba9abfee2f8d2e0c
Partial-Bug: #1746336
This commit is contained in:
James Slagle 2018-01-30 15:31:37 -05:00
parent ae35a71c54
commit dfa6cf77bc
7 changed files with 62 additions and 0 deletions

View File

@ -0,0 +1,5 @@
---
fixes:
- Support for the SshKnownHostsDeployment resources has been fixed by adding
a new role that can be used to configure /etc/ssh/ssh_known_hosts
on each host.

View File

@ -0,0 +1,41 @@
tripleo-ssh-known-hosts
=======================
An Ansible role to add all SSH host keys to the host level known hosts file on
all hosts.
Requirements
------------
This section needs to be documented.
Role variables
--------------
- ssh_known_hosts: -- Dict of hostname to ssh_known_hosts entries for a given
host
Dependencies
------------
None.
Example Playbook
----------------
Sample playbook to call the role:
- name: Configure SSH known hosts
hosts: all
roles:
- tripleo-ssh-known-hosts
License
-------
Free software: Apache License (2.0)
Author Information
------------------
OpenStack TripleO team

View File

@ -0,0 +1,3 @@
---
ssh_known_hosts: {}

View File

@ -0,0 +1 @@
---

View File

@ -0,0 +1 @@
---

View File

@ -0,0 +1,8 @@
---
- name: Template /etc/ssh/ssh_known_hosts
template:
src: ssh_known_hosts.j2
dest: /etc/ssh/ssh_known_hosts
tags:
- tripleo_ssh_known_hosts

View File

@ -0,0 +1,3 @@
{% for host in groups['overcloud'] %}
{{ ssh_known_hosts[hostvars[host]['ansible_nodename']] + ' ' + hostvars[host]['ansible_ssh_host_key_ecdsa_public'] }}
{% endfor %}