Swift storage heat templates
[apex-tripleo-heat-templates.git] / swift-storage-source.yaml
1 HeatTemplateFormatVersion: '2012-12-12'
2 Description: 'Common Swift Storage Configuration'
3 Parameters:
4   SwiftStorageImage:
5     Type: String
6     Default: overcloud-swift-storage
7   OvercloudSwiftStorageFlavor:
8     Default: baremetal
9     Description: Flavor for Swift storage nodes to request when deploying.
10     Type: String
11   NeutronNetworkType:
12     Type: String
13     Default: 'gre'
14 Resources:
15   SwiftStorageAccessPolicy:
16     Type: OS::Heat::AccessPolicy
17     Properties:
18       AllowedResources:
19       - SwiftStorage0
20       - SwiftStorage0Config
21   SwiftStorageUser:
22     Type: AWS::IAM::User
23     Properties:
24       Policies: [ { Ref: SwiftStorageAccessPolicy } ]
25   SwiftStorage0Key:
26     Type: AWS::IAM::AccessKey
27     Properties:
28       UserName:
29         Ref: SwiftStorageUser
30   SwiftStorage0CompletionCondition:
31     Type: AWS::CloudFormation::WaitCondition
32     DependsOn: notCompute0Config
33     Properties:
34       Handle: {Ref: SwiftStorage0CompletionHandle}
35       Count: '1'
36       Timeout: '1800'
37   SwiftStorage0CompletionHandle:
38     Type: AWS::CloudFormation::WaitConditionHandle
39   SwiftStorage0:
40     Type: OS::Nova::Server
41     Properties:
42       image:
43         {Ref: SwiftStorageImage}
44       flavor: {Ref: OvercloudSwiftStorageFlavor}
45       key_name: {Ref: KeyName}
46     Metadata:
47       os-collect-config:
48         cfn:
49           access_key_id:
50             Ref: SwiftStorage0Key
51           secret_access_key:
52             Fn::GetAtt: [ SwiftStorage0Key, SecretAccessKey ]
53           stack_name: {Ref: 'AWS::StackName'}
54           path: SwiftStorage0Config.Metadata
55       OpenStack::ImageBuilder::Elements: [ swift ]
56   SwiftStorage0Config:
57     Type: AWS::AutoScaling::LaunchConfiguration
58     Properties:
59       InstanceType: '0'
60       ImageId: '0'
61     Metadata:
62       completion-handle:
63         Ref: SwiftStorage0CompletionHandle
64       os-collect-config:
65         cfn:
66           access_key_id:
67             Ref: SwiftStorage0Key
68           secret_access_key:
69             Fn::GetAtt: [ SwiftStorage0Key, SecretAccessKey ]
70           stack_name: {Ref: 'AWS::StackName'}
71           path: SwiftStorage0Config.Metadata
72       admin-password: {Ref: AdminPassword}
73       neutron:
74         ovs:
75           local_ip:
76             Fn::Select:
77               - 0
78               - Fn::Select:
79                 - ctlplane
80                 - Fn::GetAtt:
81                   - SwiftStorage0
82                   - networks
83           tenant_network_type: {Ref: NeutronNetworkType}
84         service-password:
85           Ref: NeutronPassword
86       swift:
87         devices:
88           Fn::Join:
89           - ', '
90           - - Fn::Join:
91               - ''
92               - - 'r1z1-'
93                 - Fn::Select:
94                   - 0
95                   - Fn::Select:
96                     - 'ctlplane'
97                     - Fn::GetAtt:
98                       - notCompute0
99                       - networks
100                 - ':%PORT%/d1'
101             - Fn::Join:
102               - ', '
103               - Merge::Map:
104                   SwiftStorage0:
105                     Fn::Join:
106                     - ''
107                     - - 'r1z1-'
108                       - Fn::Select:
109                         - 0
110                         - Fn::Select:
111                           - 'ctlplane'
112                           - Fn::GetAtt:
113                             - SwiftStorage0
114                             - networks
115                       - ':%PORT%/d1'
116         hash:
117           Ref: SwiftHashSuffix
118         part-power: 10
119         replicas: 1
120         service-password:
121           Ref: SwiftPassword