tripleo-heat-templates/extraconfig/tasks/ssh/known_hosts_config.yaml
Carlos Camacho 927495fe3d Change template names to queens
The new master branch should point now to queens instead of pike.

So, HOT templates should specify that they might contain features
for queens release [1]

[1]: https://docs.openstack.org/heat/latest/template_guide/hot_spec.html#queens

Change-Id: I7654d1c59db0c4508a9d7045f452612d22493004
2017-11-23 10:15:32 +01:00

36 lines
838 B
YAML

heat_template_version: queens
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}