Merge "Update: clean keepalived and radvd instances after pcs cluster stop"
[apex-tripleo-heat-templates.git] / puppet / extraconfig / tls / ca-inject.yaml
1 heat_template_version: 2015-04-30
2
3 description: >
4   This is a template which will inject the trusted anchor.
5
6 parameters:
7   # Can be overriden via parameter_defaults in the environment
8   SSLRootCertificate:
9     description: >
10       The content of a CA's SSL certificate file in PEM format.
11       This is evaluated on the client side.
12     type: string
13   SSLRootCertificatePath:
14     default: '/etc/pki/ca-trust/source/anchors/ca.crt.pem'
15     description: >
16       The filepath of the root certificate as it will be stored in the nodes.
17       Note that the path has to be one that can be picked up by the update
18       trust anchor command. e.g. in RHEL it would be
19       /etc/pki/ca-trust/source/anchors/ca.crt.pem
20     type: string
21   UpdateTrustAnchorsCommand:
22     default: update-ca-trust extract
23     description: >
24         command that will be executed to update the trust anchors.
25     type: string
26
27   # Passed in by controller.yaml
28   server:
29     description: ID of the node to apply this config to
30     type: string
31
32 resources:
33   CAConfig:
34     type: OS::Heat::SoftwareConfig
35     properties:
36       group: script
37       inputs:
38         - name: cacert_path
39         - name: cacert_content
40         - name: update_anchor_command
41       outputs:
42         - name: root_cert_md5sum
43       config: |
44         #!/bin/sh
45         cat > ${cacert_path} << EOF
46         ${cacert_content}
47         EOF
48         chmod 0440 ${cacert_path}
49         chown root:root ${cacert_path}
50         ${update_anchor_command}
51         md5sum ${cacert_path} > ${heat_outputs_path}.root_cert_md5sum
52
53   CADeployment:
54     type: OS::Heat::SoftwareDeployment
55     properties:
56       config: {get_resource: CAConfig}
57       server: {get_param: server}
58       input_values:
59         cacert_path: {get_param: SSLRootCertificatePath}
60         cacert_content: {get_param: SSLRootCertificate}
61         update_anchor_command: {get_param: UpdateTrustAnchorsCommand}
62
63 outputs:
64   deploy_stdout:
65     description: Deployment reference
66     value: {get_attr: [CADeployment, root_cert_md5sum]}