Merge "Support multiple meter dispatchers in ceilometer config"
[apex-tripleo-heat-templates.git] / deployed-server / deployed-server.yaml
1 heat_template_version: 2014-10-16
2 parameters:
3   image:
4     type: string
5     default: unused
6   flavor:
7     type: string
8     default: unused
9   key_name:
10     type: string
11     default: unused
12   security_groups:
13     type: json
14     default: []
15   # Require this so we can validate the parent passes the
16   # correct value
17   user_data_format:
18     type: string
19   user_data:
20     type: string
21     default: ''
22   name:
23     type: string
24     default: ''
25   image_update_policy:
26     type: string
27     default: ''
28   networks:
29     type: comma_delimited_list
30     default: ''
31   metadata:
32     type: json
33     default: {}
34   software_config_transport:
35     default: POLL_SERVER_CFN
36     type: string
37   scheduler_hints:
38     type: json
39     description: Optional scheduler hints to pass to nova
40     default: {}
41
42 resources:
43   # We just need something which returns a unique ID, but we can't
44   # use RandomString because RefId returns the value, not the physical
45   # resource ID, SoftwareConfig should work as it returns a UUID
46   deployed-server:
47     type: OS::TripleO::DeployedServerConfig
48     properties:
49       user_data_format: SOFTWARE_CONFIG
50
51   InstanceIdConfig:
52     type: OS::Heat::StructuredConfig
53     properties:
54       group: os-apply-config
55       config:
56         instance-id: {get_attr: [deployed-server, "OS::stack_id"]}
57
58   InstanceIdDeployment:
59     type: OS::Heat::StructuredDeployment
60     properties:
61       config: {get_resource: InstanceIdConfig}
62       server: {get_resource: deployed-server}
63
64   HostsEntryConfig:
65     type: OS::Heat::SoftwareConfig
66     properties:
67       group: script
68       config: |
69           #!/bin/bash
70           set -eux
71           mkdir -p $heat_outputs_path
72           host=$(hostnamectl --transient)
73           echo -n $host > $heat_outputs_path.hostname
74           cat $heat_outputs_path.hostname
75       outputs:
76         - name: hostname
77           description: hostname
78
79   HostsEntryDeployment:
80     type: OS::Heat::SoftwareDeployment
81     properties:
82       config: {get_resource: HostsEntryConfig}
83       server: {get_resource: deployed-server}
84
85   ControlPlanePort:
86     type: OS::TripleO::DeployedServer::ControlPlanePort
87     properties:
88       Hostname: {get_attr: [HostsEntryDeployment, hostname]}
89
90 outputs:
91   # FIXME(shardy) this is needed because TemplateResource returns an
92   # ARN not a UUID, which overflows the Deployment server_id column..
93   OS::stack_id:
94     value: {get_attr: [deployed-server, "OS::stack_id"]}
95   networks:
96     value:
97       ctlplane:
98         - {get_attr: [ControlPlanePort, ip_address]}
99   name:
100     value: {get_attr: [HostsEntryDeployment, hostname]}