Gather all hypervisor names into /etc/hosts.
[apex-tripleo-heat-templates.git] / overcloud-source.yaml
1 Description: Nova API,Keystone,Heat Engine and API,Glance,Neutron,Dedicated MySQL
2   server,Dedicated RabbitMQ Server,Group of Nova Computes
3 HeatTemplateFormatVersion: '2012-12-12'
4 Parameters:
5   AdminPassword:
6     Default: unset
7     Description: The password for the keystone admin account, used for monitoring, querying neutron etc.
8     Type: String
9     NoEcho: true
10   AdminToken:
11     Default: unset
12     Description: The keystone auth secret.
13     Type: String
14     NoEcho: true
15   CinderPassword:
16     Default: unset
17     Description: The password for the cinder service account, used by cinder-api.
18     Type: String
19     NoEcho: true
20   Flavor:
21     Default: baremetal
22     Description: Flavor to request when deploying.
23     Type: String
24   GlancePassword:
25     Default: unset
26     Description: The password for the glance service account, used by the glance services.
27     Type: String
28     NoEcho: true
29   HeatPassword:
30     Default: unset
31     Description: The password for the Heat service account, used by the Heat services.
32     Type: String
33     NoEcho: true
34   ImageUpdatePolicy:
35     Default: 'REPLACE'
36     Description: What policy to use when reconstructing instances. REBUILD for rebuilds, REBUILD_PRESERVE_EPHEMERAL to preserve /mnt.
37     Type: String
38   KeyName:
39     Default: default
40     Description: Name of an existing EC2 KeyPair to enable SSH access to the instances
41     Type: String
42   NeutronBridgeMappings:
43     Description: The OVS logical->physical bridge mappings to use.
44     Type: String
45     Default: ''
46   NeutronPassword:
47     Default: unset
48     Description: The password for the neutron service account, used by neutron agents.
49     Type: String
50     NoEcho: true
51   CeilometerComputeAgent:
52     Description: Indicates whether the Compute agent is present and expects nova-compute to be configured accordingly
53     Type: String
54     Default: ''
55     AllowedValues: ['', Present]
56   CeilometerMeteringSecret:
57     Default: unset
58     Description: Secret shared by the ceilometer services.
59     Type: String
60     NoEcho: true
61   CeilometerPassword:
62     Default: unset
63     Description: The password for the ceilometer service account.
64     Type: String
65     NoEcho: true
66   CloudName:
67     Default: ''
68     Description: The DNS name of this cloud. E.g. ci-overcloud.tripleo.org
69     Type: String
70   NovaComputeDriver:
71     Default: libvirt.LibvirtDriver
72     Type: String
73   NovaComputeLibvirtType:
74     Default: ''
75     Type: String
76   NovaImage:
77     Type: String
78     Default: overcloud-compute
79   NovaPassword:
80     Default: unset
81     Description: The password for the nova service account, used by nova-api.
82     Type: String
83     NoEcho: true
84   NeutronFlatNetworks:
85     Type: String
86     Default: ''
87     Description: If set, flat networks to configure in neutron plugins.
88   HypervisorNeutronPhysicalBridge:
89     Default: ''
90     Description: An OVS bridge to create on each hypervisor.
91     Type: String
92   HypervisorNeutronPublicInterface:
93     Default: ''
94     Description: What interface to add to the HypervisorNeutronPhysicalBridge.
95     Type: String
96   NeutronPublicInterface:
97     Default: eth0
98     Description: What interface to bridge onto br-ex for network nodes.
99     Type: String
100   NeutronPublicInterfaceDefaultRoute:
101     Default: ''
102     Description: A custom default route for the NeutronPublicInterface.
103     Type: String
104   NeutronPublicInterfaceIP:
105     Default: ''
106     Description: A custom IP address to put onto the NeutronPublicInterface.
107     Type: String
108   NeutronPublicInterfaceRawDevice:
109     Default: ''
110     Description: If set, the public interface is a vlan with this device as the raw device.
111     Type: String
112   notcomputeImage:
113     Type: String
114     Default: overcloud-control
115   NtpServer:
116     Type: String
117     Default: ''
118   RabbitUserName:
119     Default: guest
120     Description: The username for RabbitMQ
121     Type: String
122   RabbitPassword:
123     Default: guest
124     Description: The password for RabbitMQ
125     Type: String
126     NoEcho: true
127 Resources:
128   AccessPolicy:
129     Properties:
130       AllowedResources:
131       - notCompute0
132       - notCompute0Config
133     Type: OS::Heat::AccessPolicy
134   ComputeAccessPolicy:
135     Properties:
136       AllowedResources:
137       - NovaCompute0
138       - NovaCompute0Config
139     Type: OS::Heat::AccessPolicy
140   notCompute0Key:
141     Properties:
142       UserName:
143         Ref: User
144     Type: AWS::IAM::AccessKey
145   notCompute0CompletionCondition:
146     Type: AWS::CloudFormation::WaitCondition
147     DependsOn: notCompute0
148     Properties:
149       Handle: {Ref: notCompute0CompletionHandle}
150       Count: '1'
151       Timeout: '1800'
152   notCompute0CompletionHandle:
153     Type: OS::Heat::UpdateWaitConditionHandle
154   NovaCompute0Key:
155     Type: FileInclude
156     Path: nova-compute-instance.yaml
157     SubKey: Resources.NovaCompute0Key
158   NovaCompute0CompletionCondition:
159     Type: FileInclude
160     Path: nova-compute-instance.yaml
161     SubKey: Resources.NovaCompute0CompletionCondition
162   NovaCompute0CompletionHandle:
163     Type: FileInclude
164     Path: nova-compute-instance.yaml
165     SubKey: Resources.NovaCompute0CompletionHandle
166   ComputeUser:
167     Properties:
168       Policies:
169       - Ref: ComputeAccessPolicy
170     Type: AWS::IAM::User
171   NovaCompute0Config:
172     Type: FileInclude
173     Path: nova-compute-instance.yaml
174     SubKey: Resources.NovaCompute0Config
175     Parameters:
176         NovaApiHost: {"Fn::Select": [ 0, {"Fn::Select": [ "ctlplane", {"Fn::GetAtt": [notCompute0, networks]} ]} ] }
177         KeystoneHost: {"Fn::Select": [ 0, {"Fn::Select": [ "ctlplane", {"Fn::GetAtt": [notCompute0, networks]} ]} ] }
178         RabbitHost: {"Fn::Select": [ 0, {"Fn::Select": [ "ctlplane", {"Fn::GetAtt": [notCompute0, networks]} ]} ] }
179         NeutronHost: {"Fn::Select": [ 0, {"Fn::Select": [ "ctlplane", {"Fn::GetAtt": [notCompute0, networks]} ]} ] }
180         GlanceHost: {"Fn::Select": [ 0, {"Fn::Select": [ "ctlplane", {"Fn::GetAtt": [notCompute0, networks]} ]} ] }
181         NovaDSN: {"Fn::Join": ['', ['mysql://nova:unset@', {"Fn::Select": [ 0, {"Fn::Select": [ "ctlplane", {"Fn::GetAtt": [notCompute0, networks]} ]} ]}, '/nova']]}
182         CeilometerDSN: {"Fn::Join": ['', ['mysql://ceilometer:unset@', {"Fn::Select": [ 0, {"Fn::Select": [ "ctlplane", {"Fn::GetAtt": [notCompute0, networks]} ]} ]}, '/ceilometer']]}
183         NeutronDSN: {"Fn::Join": ['', ['mysql://neutron:unset@', {"Fn::Select": [ 0, {"Fn::Select": [ "ctlplane", {"Fn::GetAtt": [notCompute0, networks]} ]} ]}, '/neutron']]}
184         NeutronNetworkType: "gre"
185         NeutronEnableTunnelling: "True"
186         NeutronFlatNetworks:
187             Ref: NeutronFlatNetworks
188         NeutronNetworkVLANRanges: ""
189         NeutronPhysicalBridge:
190             Ref: HypervisorNeutronPhysicalBridge
191         NeutronPublicInterface:
192             Ref: HypervisorNeutronPublicInterface
193         NeutronBridgeMappings:
194             Ref: NeutronBridgeMappings
195         StaticHosts:
196           Fn::Join:
197           - "\n"
198           - - Fn::Join:
199               - "\n"
200               - Merge::Map:
201                   NovaCompute0:
202                     Fn::Join:
203                     - ' '
204                     - - Fn::Select:
205                         - 0
206                         - Fn::Select:
207                           - ctlplane
208                           - Fn::GetAtt:
209                             - NovaCompute0
210                             - networks
211                       - Fn::Select:
212                         - name
213                         - Fn::GetAtt:
214                           - NovaCompute0
215                           - show
216                       - Fn::Join:
217                         - '.'
218                         - - Fn::Select:
219                             - name
220                             - Fn::GetAtt:
221                               - NovaCompute0
222                               - show
223                           - 'local'
224             - Fn::Join:
225               - ' '
226               - - Fn::Select:
227                   - 0
228                   - Fn::Select:
229                     - ctlplane
230                     - Fn::GetAtt:
231                       - notCompute0
232                       - networks
233                 - {Ref: CloudName}
234                 # If CloudName is unset, make the hosts line still valid
235                 - unused
236   NovaCompute0:
237     Type: FileInclude
238     Path: nova-compute-instance.yaml
239     SubKey: Resources.NovaCompute0
240   User:
241     Properties:
242       Policies:
243       - Ref: AccessPolicy
244     Type: AWS::IAM::User
245   notCompute0Config:
246     Type: AWS::AutoScaling::LaunchConfiguration
247     Properties:
248       ImageId: '0'
249       InstanceType: '0'
250     Metadata:
251       OpenStack::Heat::Stack: {}
252       OpenStack::ImageBuilder::Elements:
253       - boot-stack
254       - heat-cfntools
255       - heat-localip
256       - neutron-network-node
257       admin-password:
258         Ref: AdminPassword
259       admin-token:
260         Ref: AdminToken
261       bootstack:
262         public_interface_ip:
263           Ref: NeutronPublicInterfaceIP
264       cinder:
265         db: mysql://cinder:unset@localhost/cinder
266         volume_size_mb: '5000'
267         service-password:
268           Ref: CinderPassword
269       completion-handle:
270         Ref: notCompute0CompletionHandle
271       controller-address:
272         Fn::Select:
273          - 0
274          - Fn::Select:
275              - 'ctlplane'
276              - Fn::GetAtt:
277                - notCompute0
278                - networks
279       db-password: unset
280       glance:
281         backend: swift
282         db: mysql://glance:unset@localhost/glance
283         host:
284           Fn::Select:
285            - 0
286            - Fn::Select:
287                - 'ctlplane'
288                - Fn::GetAtt:
289                  - notCompute0
290                  - networks
291         service-password:
292           Ref: GlancePassword
293         swift-store-user: service:glance
294         swift-store-key:
295           Ref: GlancePassword
296       heat:
297         admin_password:
298           Ref: HeatPassword
299         admin_tenant_name: service
300         admin_user: heat
301         auth_encryption_key: unset___________
302         db: mysql://heat:unset@localhost/heat
303         watch_server_url:
304           Fn::Join:
305             - ''
306             - - 'http://'
307               - Fn::Select:
308                 - 0
309                 - Fn::Select:
310                   - 'ctlplane'
311                   - Fn::GetAtt:
312                     - notCompute0
313                     - networks
314               - ':8003'
315         metadata_server_url:
316           Fn::Join:
317             - ''
318             - - 'http://'
319               - Fn::Select:
320                 - 0
321                 - Fn::Select:
322                   - 'ctlplane'
323                   - Fn::GetAtt:
324                     - notCompute0
325                     - networks
326               - ':8000'
327         waitcondition_server_url:
328           Fn::Join:
329             - ''
330             - - 'http://'
331               - Fn::Select:
332                 - 0
333                 - Fn::Select:
334                   - 'ctlplane'
335                   - Fn::GetAtt:
336                     - notCompute0
337                     - networks
338               - ':8000/v1/waitcondition'
339       hosts:
340         Fn::Join:
341         - ' '
342         - - Fn::Select:
343             - 0
344             - Fn::Select:
345               - ctlplane
346               - Fn::GetAtt:
347                 - notCompute0
348                 - networks
349           - {Ref: CloudName}
350       keystone:
351         db: mysql://keystone:unset@localhost/keystone
352         host:
353           Fn::Select:
354             - 0
355             - Fn::Select:
356               - 'ctlplane'
357               - Fn::GetAtt:
358                 - notCompute0
359                 - networks
360       neutron:
361         flat-networks: {Ref: NeutronFlatNetworks}
362         host:
363           Fn::Select:
364             - 0
365             - Fn::Select:
366               - ctlplane
367               - Fn::GetAtt:
368                 - notCompute0
369                 - networks
370         metadata_proxy_shared_secret: unset
371         ovs:
372           enable_tunneling: 'True'
373           local_ip:
374             Fn::Select:
375               - 0
376               - Fn::Select:
377                 - ctlplane
378                 - Fn::GetAtt:
379                   - notCompute0
380                   - networks
381           bridge_mappings: {Ref: NeutronBridgeMappings}
382           public_interface:
383             Ref: NeutronPublicInterface
384           public_interface_raw_device:
385             Ref: NeutronPublicInterfaceRawDevice
386           public_interface_route:
387             Ref: NeutronPublicInterfaceDefaultRoute
388           physical_bridge: br-ex
389           tenant_network_type: gre
390         ovs_db: mysql://neutron:unset@localhost/ovs_neutron?charset=utf8
391         service-password:
392           Ref: NeutronPassword
393       ceilometer:
394         db: mysql://ceilometer:unset@localhost/ceilometer
395         metering_secret: {Ref: CeilometerMeteringSecret}
396         service-password:
397           Ref: CeilometerPassword
398       nova:
399         compute_driver: libvirt.LibvirtDriver
400         db: mysql://nova:unset@localhost/nova
401         default_floating_pool:
402           ext-net
403         host:
404           Fn::Select:
405             - 0
406             - Fn::Select:
407               - 'ctlplane'
408               - Fn::GetAtt:
409                 - notCompute0
410                 - networks
411         metadata-proxy: true
412         service-password:
413           Ref: NovaPassword
414       os-collect-config:
415         cfn:
416           access_key_id:
417             Ref: notCompute0Key
418           path: notCompute0Config.Metadata
419           secret_access_key:
420             Fn::GetAtt:
421             - notCompute0Key
422             - SecretAccessKey
423           stack_name:
424             Ref: AWS::StackName
425       rabbit:
426         host:
427           Fn::Select:
428             - 0
429             - Fn::Select:
430               - ctlplane
431               - Fn::GetAtt:
432                 - notCompute0
433                 - networks
434         username:
435           Ref: RabbitUserName
436         password:
437           Ref: RabbitPassword
438       ntp:
439         servers:
440             - {server: {Ref: NtpServer}, fudge: "stratum 0"}
441   notCompute0:
442     Type: OS::Nova::Server
443     Properties:
444       image:
445         Ref: notcomputeImage
446       image_update_policy:
447         Ref: ImageUpdatePolicy
448       flavor:
449         Ref: Flavor
450       key_name:
451         Ref: KeyName
452     Metadata:
453       os-collect-config:
454         cfn:
455           access_key_id:
456             Ref: notCompute0Key
457           path: notCompute0Config.Metadata
458           secret_access_key:
459             Fn::GetAtt:
460             - notCompute0Key
461             - SecretAccessKey
462           stack_name:
463             Ref: AWS::StackName
464 Outputs:
465   KeystoneURL:
466     Description: URL for the Overcloud Keystone service
467     Value:
468       Fn::Join:
469       - ''
470       - - http://
471         - Fn::Select:
472           - 0
473           - Fn::Select:
474             - ctlplane
475             - Fn::GetAtt:
476               - notCompute0
477               - networks
478         - :5000/v2.0/