Add BlockStorage0Config Resource
[apex-tripleo-heat-templates.git] / block-storage.yaml
1 HeatTemplateFormatVersion: '2012-12-12'
2 Description: 'Common Block Storage Configuration'
3 Parameters:
4   BlockStorageImage:
5     Type: String
6     Default: overcloud-cinder-volume
7   OvercloudBlockStorageFlavor:
8     Default: baremetal
9     Description: Flavor for block storage nodes to request when deploying.
10     Type: String
11   NeutronNetworkType:
12     Type: String
13     Default: 'gre'
14   NeutronEnableTunnelling:
15     Type: String
16     Default: True
17 Resources:
18   BlockStorageAccessPolicy:
19     Type: OS::Heat::AccessPolicy
20     Properties:
21       AllowedResources:
22       - BlockStorage0
23       - BlockStorage0Config
24   BlockStorageUser:
25     Type: AWS::IAM::User
26     Properties:
27       Policies: [ { Ref: BlockStorageAccessPolicy } ]
28   BlockStorage0Key:
29     Type: AWS::IAM::AccessKey
30     Properties:
31       UserName:
32         Ref: BlockStorageUser
33   BlockStorage0CompletionCondition:
34     Type: AWS::CloudFormation::WaitCondition
35     DependsOn: notCompute0Config
36     Properties:
37       Handle: {Ref: BlockStorage0CompletionHandle}
38       Count: '1'
39       Timeout: '1800'
40   BlockStorage0CompletionHandle:
41     Type: AWS::CloudFormation::WaitConditionHandle
42   BlockStorage0:
43     Type: OS::Nova::Server
44     Properties:
45       image:
46         {Ref: BlockStorageImage}
47       flavor: {Ref: OvercloudBlockStorageFlavor}
48       key_name: {Ref: KeyName}
49     Metadata:
50       os-collect-config:
51         cfn:
52           access_key_id:
53             Ref: BlockStorage0Key
54           secret_access_key:
55             Fn::GetAtt: [ BlockStorage0Key, SecretAccessKey ]
56           stack_name: {Ref: 'AWS::StackName'}
57           path: BlockStorage0Config.Metadata
58       OpenStack::ImageBuilder::Elements: [ cinder ]
59   BlockStorage0Config:
60     Type: AWS::AutoScaling::LaunchConfiguration
61     Properties:
62       InstanceType: '0'
63       ImageId: '0'
64     Metadata:
65       completion-handle:
66         Ref: BlockStorage0CompletionHandle
67       os-collect-config:
68         cfn:
69           access_key_id:
70             Ref: BlockStorage0Key
71           secret_access_key:
72             Fn::GetAtt: [ BlockStorage0Key, SecretAccessKey ]
73           stack_name: {Ref: 'AWS::StackName'}
74           path: BlockStorage0Config.Metadata
75       admin-password: {Ref: AdminPassword}
76       keystone:
77         host: {"Fn::Select": [ 0, {"Fn::Select": [ "ctlplane", {"Fn::GetAtt": [notCompute0, networks]} ]} ] }
78       cinder:
79         db: {"Fn::Join": ['', ['mysql://cinder:unset@', {"Fn::Select": [ 0, {"Fn::Select": [ "ctlplane", {"Fn::GetAtt": [notCompute0, networks]} ]} ] } , '/cinder']]}
80         volume_size_mb: '5000'
81         service-password:
82           Ref: CinderPassword
83       admin-password: {Ref: AdminPassword}
84       rabbit:
85         host: {"Fn::Select": [ 0, {"Fn::Select": [ "ctlplane", {"Fn::GetAtt": [notCompute0, networks]} ]} ] }
86         username: {Ref: RabbitUserName}
87         password: {Ref: RabbitPassword}
88       interfaces:
89         control: {Ref: NeutronPublicInterface}
90       neutron:
91         ovs:
92           local_ip:
93             Fn::Select:
94               - 0
95               - Fn::Select:
96                 - ctlplane
97                 - Fn::GetAtt:
98                   - BlockStorage0
99                   - networks
100           tenant_network_type: {Ref: NeutronNetworkType}
101           enable_tunneling: {Ref: NeutronEnableTunnelling}
102         service-password:
103           Ref: NeutronPassword