Merge "Mount /var/lib/neutron in neutron agents for metadata proxy"
[apex-tripleo-heat-templates.git] / extraconfig / tasks / ssh / host_public_key.yaml
1 heat_template_version: pike
2
3 description: >
4   This is a template which will fetch the ssh host public key.
5
6 parameters:
7   server:
8     description: ID of the node to apply this config to
9     type: string
10   deployment_actions:
11     default: ['CREATE', 'UPDATE']
12     type: comma_delimited_list
13     description: >
14       List of stack actions that will trigger any deployments in this
15       templates. The actions will be an empty list of the server is in the
16       toplevel DeploymentServerBlacklist parameter's value.
17
18 resources:
19   SshHostPubKeyConfig:
20     type: OS::Heat::SoftwareConfig
21     properties:
22       group: script
23       outputs:
24       - name: rsa
25       - name: ecdsa
26       - name: ed25519
27       config: |
28         #!/bin/sh -x
29         test -e '/etc/ssh/ssh_host_rsa_key.pub' && cat /etc/ssh/ssh_host_rsa_key.pub > $heat_outputs_path.rsa
30         test -e '/etc/ssh/ssh_host_ecdsa_key.pub' && cat /etc/ssh/ssh_host_ecdsa_key.pub > $heat_outputs_path.ecdsa
31         test -e '/etc/ssh/ssh_host_ed25519_key.pub' && cat /etc/ssh/ssh_host_ed25519_key.pub > $heat_outputs_path.ed25519
32
33   SshHostPubKeyDeployment:
34     type: OS::Heat::SoftwareDeployment
35     properties:
36       config: {get_resource: SshHostPubKeyConfig}
37       server: {get_param: server}
38       actions: {get_param: deployment_actions}
39       name: SshHostPubKeyDeployment
40
41
42 outputs:
43   ecdsa:
44     description: Host ssh public key (ecdsa)
45     value:  {get_attr: [SshHostPubKeyDeployment, ecdsa]}
46   rsa:
47     description: Host ssh public key (rsa)
48     value:  {get_attr: [SshHostPubKeyDeployment, rsa]}
49   ed25519:
50     description: Host ssh public key (ed25519)
51     value:  {get_attr: [SshHostPubKeyDeployment, ed25519]}