Bump template version for all templates to "ocata"
[apex-tripleo-heat-templates.git] / deployed-server / deployed-server.yaml
1 heat_template_version: ocata
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: 'deployed-server'
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   deployed-server:
44     type: OS::Heat::DeployedServer
45     properties:
46       name: {get_param: name}
47       software_config_transport: {get_param: software_config_transport}
48
49   InstanceIdConfig:
50     type: OS::Heat::StructuredConfig
51     properties:
52       group: apply-config
53       config:
54         instance-id: {get_resource: deployed-server}
55
56   InstanceIdDeployment:
57     type: OS::Heat::StructuredDeployment
58     properties:
59       config: {get_resource: InstanceIdConfig}
60       server: {get_resource: deployed-server}
61
62   HostsEntryConfig:
63     type: OS::Heat::SoftwareConfig
64     properties:
65       group: script
66       config: |
67           #!/bin/bash
68           set -eux
69           mkdir -p $heat_outputs_path
70           host=$(hostname -s)
71           echo -n $host > $heat_outputs_path.hostname
72           cat $heat_outputs_path.hostname
73       outputs:
74         - name: hostname
75           description: hostname
76
77   HostsEntryDeployment:
78     type: OS::Heat::SoftwareDeployment
79     properties:
80       config: {get_resource: HostsEntryConfig}
81       server: {get_resource: deployed-server}
82
83   ControlPlanePortImpl:
84     type: OS::TripleO::DeployedServer::ControlPlanePort
85     properties:
86       network: ctlplane
87       name:
88         list_join:
89           - '-'
90           - - {get_attr: [HostsEntryDeployment, hostname]}
91             - ctlplane
92       replacement_policy: AUTO
93
94 outputs:
95   OS::stack_id:
96     value: {get_resource: deployed-server}
97   networks:
98     value:
99       ctlplane:
100         - {get_attr: [ControlPlanePortImpl, fixed_ips, 0, ip_address]}
101   name:
102     value: {get_attr: [HostsEntryDeployment, hostname]}