Merge "Adding NTP to undercloud template"
[apex-tripleo-heat-templates.git] / undercloud-source.yaml
1 Description: All-in-one baremetal OpenStack and all dependencies.
2 HeatTemplateFormatVersion: '2012-12-12'
3 Parameters:
4   AdminPassword:
5     Default: unset
6     Description: The password for the keystone admin account, used for monitoring, querying neutron etc.
7     Type: String
8     NoEcho: true
9   AdminToken:
10     Default: unset
11     Description: The keystone auth secret.
12     Type: String
13     NoEcho: true
14   BaremetalArch:
15     Default: i386
16     Description: The architecture to use in Nova-BM - i386 or amd64.
17     Type: String
18   Flavor:
19     Default: baremetal
20     Description: Flavor to request when deploying.
21     Type: String
22   GlancePassword:
23     Default: unset
24     Description: The password for the glance service account, used by the glance services.
25     Type: String
26     NoEcho: true
27   GlanceNotifierStrategy:
28     Description: Strategy to use for Glance notification queue
29     Type: String
30     Default: noop
31   GlanceLogFile:
32     Description: The filepath of the file to use for logging messages from Glance.
33     Type: String
34     Default: ''
35   KeyName:
36     Default: default
37     Description: Name of an existing EC2 KeyPair to enable SSH access to the instances
38     Type: String
39   HeatPassword:
40     Default: unset
41     Description: The password for the Heat service account, used by the Heat services.
42     Type: String
43     NoEcho: true
44   ImageUpdatePolicy:
45     Default: REBUILD_PRESERVE_EPHEMERAL
46     Description: What policy to use when reconstructing instances. REBUILD for rebuilds,
47       REBUILD_PRESERVE_EPHEMERAL to preserve /mnt.
48     Type: String
49   undercloudImage:
50     Default: undercloud
51     Type: String
52   NeutronPassword:
53     Default: unset
54     Description: The password for the neutron service account, used by neutron agents.
55     Type: String
56     NoEcho: true
57   NovaPassword:
58     Default: unset
59     Description: The password for the nova service account, used by nova-api.
60     Type: String
61     NoEcho: true
62   NtpServer:
63     Type: String
64     Default: ''
65   RabbitUserName:
66     Default: guest
67     Description: The username for RabbitMQ
68     Type: String
69   RabbitPassword:
70     Default: guest
71     Description: The password for RabbitMQ
72     Type: String
73     NoEcho: true
74   RabbitCookieSalt:
75     Type: String
76     Default: unset
77     Description: Salt for the rabbit cookie, change this to force the randomly generated rabbit cookie to change.
78   HeatStackDomainAdminPassword:
79     Description: Password for heat_domain_admin user.
80     Type: String
81     Default: ''
82     NoEcho: true
83   MysqlInnodbBufferPoolSize:
84     Description: Specifies the size of the buffer pool in megabytes.
85     Type: Number
86     Default: 100
87 Resources:
88   RabbitCookie:
89     Type: OS::Heat::RandomString
90     Properties:
91       length: 20
92       salt:
93         Ref: RabbitCookieSalt
94   AccessPolicy:
95     Properties:
96       AllowedResources:
97       - undercloudConfig
98     Type: OS::Heat::AccessPolicy
99   notCompute0Key:
100     Properties:
101       UserName:
102         Ref: User
103     Type: AWS::IAM::AccessKey
104   notCompute0CompletionCondition:
105     Type: AWS::CloudFormation::WaitCondition
106     DependsOn: undercloud
107     Properties:
108       Handle: {Ref: notCompute0CompletionHandle}
109       Count: '1'
110       Timeout: '1800'
111   notCompute0CompletionHandle:
112     Type: AWS::CloudFormation::WaitConditionHandle
113   User:
114     Properties:
115       Policies:
116       - Ref: AccessPolicy
117     Type: AWS::IAM::User
118   undercloudConfig:
119     Type: AWS::AutoScaling::LaunchConfiguration
120     Properties:
121       ImageId: '0'
122       InstanceType: foo
123     Metadata:
124       OpenStack::Role: undercloudConfig
125       OpenStack::Heat::Stack: {}
126       OpenStack::ImageBuilder::Elements: [ boot-stack, heat-cfntools, neutron-network-node ]
127       admin-password:
128         Ref: AdminPassword
129       admin-token: 
130         Ref: AdminToken
131       controller-address:
132         Fn::Select:
133           - 0
134           - Fn::Select:
135             - "ctlplane"
136             - Fn::GetAtt:
137               - undercloud
138               - networks
139       cinder:
140         db: mysql://cinder:unset@localhost/cinder
141         volume_size_mb: '5000'
142       completion-handle:
143         Ref: notCompute0CompletionHandle
144       db-password: unset
145       glance:
146         backend: file
147         db: mysql://glance:unset@localhost/glance
148         host: 127.0.0.1
149         service-password:
150           Ref: GlancePassword
151         notifier-strategy:
152           Ref: GlanceNotifierStrategy
153         log-file:
154           Ref: GlanceLogFile
155       heat:
156         admin_password:
157           Ref: HeatPassword
158         admin_tenant_name: service
159         admin_user: heat
160         auth_encryption_key: unset___________
161         db: mysql://heat:unset@localhost/heat
162         stack_domain_admin_password: {Ref: HeatStackDomainAdminPassword}
163         watch_server_url:
164           Fn::Join:
165             - ''
166             - - http://
167               - Fn::Select:
168                   - 0
169                   - Fn::Select:
170                     - "ctlplane"
171                     - Fn::GetAtt:
172                       - undercloud
173                       - networks
174               - ":8003"
175         metadata_server_url:
176           Fn::Join:
177             - ''
178             - - http://
179               - Fn::Select:
180                   - 0
181                   - Fn::Select:
182                     - "ctlplane"
183                     - Fn::GetAtt:
184                       - undercloud
185                       - networks
186               - ":8000"
187         waitcondition_server_url:
188           Fn::Join:
189             - ''
190             - - http://
191               - Fn::Select:
192                   - 0
193                   - Fn::Select:
194                     - "ctlplane"
195                     - Fn::GetAtt:
196                       - undercloud
197                       - networks
198               - ":8000/v1/waitcondition"
199       os-collect-config:
200         cfn:
201           access_key_id:
202             Ref: notCompute0Key
203           path: undercloudConfig.Metadata
204           secret_access_key:
205             Fn::GetAtt:
206             - notCompute0Key
207             - SecretAccessKey
208           stack_name:
209             Ref: AWS::StackName
210       keystone:
211         db: mysql://keystone:unset@localhost/keystone
212         host: 127.0.0.1
213       mysql:
214         innodb_buffer_pool_size: {Ref: MysqlInnodbBufferPoolSize}
215       neutron:
216         host: 127.0.0.1
217         ovs_db: mysql://neutron:unset@localhost/ovs_neutron?charset=utf8
218         ovs:
219           public_interface:
220             Ref: NeutronPublicInterface
221           physical_bridge: br-ctlplane
222           physical_network: ctlplane
223           network_vlan_ranges: ctlplane
224           bridge_mappings: ctlplane:br-ctlplane
225           tenant_network_type: vlan
226           enable_tunneling: 'False'
227         service-password:
228           Ref: NeutronPassword
229       ntp:
230         servers:
231             - {server: {Ref: NtpServer}, fudge: "stratum 0"}
232       rabbit:
233         host: 127.0.0.1
234         username:
235           Ref: RabbitUserName
236         password:
237           Ref: RabbitPassword
238         cookie:
239           Fn::GetAtt:
240           - RabbitCookie
241           - value
242   undercloud:
243     Type: OS::Nova::Server
244     Properties:
245       image:
246         Ref: undercloudImage
247       flavor:
248         Ref: Flavor
249       key_name:
250         Ref: KeyName
251       image_update_policy:
252         Ref: ImageUpdatePolicy
253     Metadata:
254       os-collect-config:
255         cfn:
256           access_key_id:
257             Ref: notCompute0Key
258           path: undercloudConfig.Metadata
259           secret_access_key:
260             Fn::GetAtt:
261             - notCompute0Key
262             - SecretAccessKey
263           stack_name:
264             Ref: AWS::StackName