Make Wait Conditions depend on config creation
[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   KeyName:
28     Default: default
29     Description: Name of an existing EC2 KeyPair to enable SSH access to the instances
30     Type: String
31   HeatPassword:
32     Default: unset
33     Description: The password for the Heat service account, used by the Heat services.
34     Type: String
35     NoEcho: true
36   undercloudImage:
37     Default: undercloud
38     Type: String
39   NeutronPassword:
40     Default: unset
41     Description: The password for the neutron service account, used by neutron agents.
42     Type: String
43     NoEcho: true
44   NovaPassword:
45     Default: unset
46     Description: The password for the nova service account, used by nova-api.
47     Type: String
48     NoEcho: true
49   RabbitUserName:
50     Default: guest
51     Description: The username for RabbitMQ
52     Type: String
53   RabbitPassword:
54     Default: guest
55     Description: The password for RabbitMQ
56     Type: String
57     NoEcho: true
58 Resources:
59   AccessPolicy:
60     Properties:
61       AllowedResources:
62       - undercloudConfig
63     Type: OS::Heat::AccessPolicy
64   notCompute0Key:
65     Properties:
66       UserName:
67         Ref: User
68     Type: AWS::IAM::AccessKey
69   notCompute0CompletionCondition:
70     Type: AWS::CloudFormation::WaitCondition
71     DependsOn: undercloud
72     Properties:
73       Handle: {Ref: notCompute0CompletionHandle}
74       Count: '1'
75       Timeout: '1800'
76   notCompute0CompletionHandle:
77     Type: AWS::CloudFormation::WaitConditionHandle
78   User:
79     Properties:
80       Policies:
81       - Ref: AccessPolicy
82     Type: AWS::IAM::User
83   undercloudConfig:
84     Type: AWS::AutoScaling::LaunchConfiguration
85     Properties:
86       ImageId: '0'
87       InstanceType: foo
88     Metadata:
89       OpenStack::Role: undercloudConfig
90       OpenStack::Heat::Stack: {}
91       OpenStack::ImageBuilder::Elements: [ boot-stack, heat-cfntools, neutron-network-node ]
92       admin-password:
93         Ref: AdminPassword
94       admin-token: 
95         Ref: AdminToken
96       controller-address:
97         Fn::Select:
98           - 0
99           - Fn::Select:
100             - "ctlplane"
101             - Fn::GetAtt:
102               - undercloud
103               - networks
104       cinder:
105         db: mysql://cinder:unset@localhost/cinder
106         volume_size_mb: '5000'
107       completion-handle:
108         Ref: notCompute0CompletionHandle
109       db-password: unset
110       glance:
111         backend: file
112         db: mysql://glance:unset@localhost/glance
113         host: 127.0.0.1
114         service-password:
115           Ref: GlancePassword
116       heat:
117         admin_password:
118           Ref: HeatPassword
119         admin_tenant_name: service
120         admin_user: heat
121         auth_encryption_key: unset___________
122         db: mysql://heat:unset@localhost/heat
123         watch_server_url:
124           Fn::Join:
125             - ''
126             - - http://
127               - Fn::Select:
128                   - 0
129                   - Fn::Select:
130                     - "ctlplane"
131                     - Fn::GetAtt:
132                       - undercloud
133                       - networks
134               - ":8003"
135         metadata_server_url:
136           Fn::Join:
137             - ''
138             - - http://
139               - Fn::Select:
140                   - 0
141                   - Fn::Select:
142                     - "ctlplane"
143                     - Fn::GetAtt:
144                       - undercloud
145                       - networks
146               - ":8000"
147         waitcondition_server_url:
148           Fn::Join:
149             - ''
150             - - http://
151               - Fn::Select:
152                   - 0
153                   - Fn::Select:
154                     - "ctlplane"
155                     - Fn::GetAtt:
156                       - undercloud
157                       - networks
158               - ":8000/v1/waitcondition"
159       os-collect-config:
160         cfn:
161           access_key_id:
162             Ref: notCompute0Key
163           path: undercloudConfig.Metadata
164           secret_access_key:
165             Fn::GetAtt:
166             - notCompute0Key
167             - SecretAccessKey
168           stack_name:
169             Ref: AWS::StackName
170       keystone:
171         db: mysql://keystone:unset@localhost/keystone
172         host: 127.0.0.1
173       neutron:
174         host: 127.0.0.1
175         ovs_db: mysql://neutron:unset@localhost/ovs_neutron?charset=utf8
176         ovs:
177           dnsmasq_range: [192.0.2.25, 192.0.2.44]
178           public_interface:
179             Ref: NeutronPublicInterface
180           physical_bridge: br-ctlplane
181           physical_network: ctlplane
182           network_vlan_ranges: ctlplane
183           bridge_mappings: ctlplane:br-ctlplane
184           tenant_network_type: vlan
185           enable_tunneling: 'False'
186         service-password:
187           Ref: NeutronPassword
188       rabbit:
189         host: 127.0.0.1
190         username:
191           Ref: RabbitUserName
192         password:
193           Ref: RabbitPassword
194   undercloud:
195     Type: OS::Nova::Server
196     Properties:
197       image:
198         Ref: undercloudImage
199       flavor:
200         Ref: Flavor
201       key_name:
202         Ref: KeyName
203     Metadata:
204       os-collect-config:
205         cfn:
206           access_key_id:
207             Ref: notCompute0Key
208           path: undercloudConfig.Metadata
209           secret_access_key:
210             Fn::GetAtt:
211             - notCompute0Key
212             - SecretAccessKey
213           stack_name:
214             Ref: AWS::StackName