aboutsummaryrefslogtreecommitdiffstats
path: root/extraconfig/tasks/ssh/known_hosts_config.yaml
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-04-25 16:48:39 +0000
committerGerrit Code Review <review@openstack.org>2017-04-25 16:48:39 +0000
commit1822ab1c4a201ac952200b52ab600661ea3fea97 (patch)
treeac3eb413abc8288f335ef7f7a6bfaa3071bb552c /extraconfig/tasks/ssh/known_hosts_config.yaml
parent374b101683eb695b4aad44cb086c1a1748042d12 (diff)
parent68d7196d472b5195c19e871e960996e89a7bcb9c (diff)
Merge "SSH known_hosts config" into stable/ocata
Diffstat (limited to 'extraconfig/tasks/ssh/known_hosts_config.yaml')
-rw-r--r--extraconfig/tasks/ssh/known_hosts_config.yaml36
1 files changed, 36 insertions, 0 deletions
diff --git a/extraconfig/tasks/ssh/known_hosts_config.yaml b/extraconfig/tasks/ssh/known_hosts_config.yaml
new file mode 100644
index 00000000..2ebcb63c
--- /dev/null
+++ b/extraconfig/tasks/ssh/known_hosts_config.yaml
@@ -0,0 +1,36 @@
+heat_template_version: ocata
+description: 'SSH Known Hosts Config'
+
+parameters:
+ known_hosts:
+ type: string
+
+resources:
+
+ SSHKnownHostsConfig:
+ type: OS::Heat::SoftwareConfig
+ properties:
+ group: script
+ inputs:
+ - name: known_hosts
+ default: {get_param: known_hosts}
+ config: |
+ #!/bin/bash
+ set -eux
+ set -o pipefail
+
+ echo "Creating ssh known hosts file"
+
+ if [ ! -z "${known_hosts}" ]; then
+ echo "${known_hosts}"
+ echo -ne "${known_hosts}" > /etc/ssh/ssh_known_hosts
+ chmod 0644 /etc/ssh/ssh_known_hosts
+ else
+ rm -f /etc/ssh/ssh_known_hosts
+ echo "No ssh known hosts"
+ fi
+
+outputs:
+ OS::stack_id:
+ description: The SSHKnownHostsConfig resource.
+ value: {get_resource: SSHKnownHostsConfig} \ No newline at end of file