Wire in hieradata overrides via ExtraConfig for ObjectStorage
[apex-tripleo-heat-templates.git] / swift-storage.yaml
1 heat_template_version: 2015-04-30
2 description: 'Common Swift Storage Configuration'
3 parameters:
4   ExtraConfig:
5     default: {}
6     description: |
7       Additional configuration to inject into the cluster. The JSON should have
8       the following structure:
9         {"FILEKEY":
10           {"config":
11             [{"section": "SECTIONNAME",
12               "values":
13                 [{"option": "OPTIONNAME",
14                   "value": "VALUENAME"
15                  }
16                 ]
17              }
18             ]
19           }
20         }
21       For instance:
22         {"nova":
23           {"config":
24             [{"section": "default",
25               "values":
26                 [{"option": "force_config_drive",
27                   "value": "always"
28                  }
29                 ]
30              },
31              {"section": "cells",
32               "values":
33                 [{"option": "driver",
34                   "value": "nova.cells.rpc_driver.CellsRPCDriver"
35                  }
36                 ]
37              }
38             ]
39           }
40         }
41     type: json
42   ObjectStorageExtraConfig:
43     default: {}
44     description: |
45       Role specific additional configuration to inject into the cluster.
46     type: json
47   Flavor:
48     description: Flavor for Swift storage nodes to request when deploying.
49     type: string
50     constraints:
51       - custom_constraint: nova.flavor
52   HashSuffix:
53     default: unset
54     description: A random string to be used as a salt when hashing to determine mappings
55       in the ring.
56     hidden: true
57     type: string
58   Image:
59     default: overcloud-swift-storage
60     type: string
61   KeyName:
62     default: default
63     description: Name of an existing EC2 KeyPair to enable SSH access to the instances
64     type: string
65   MountCheck:
66     default: 'false'
67     description: Value of mount_check in Swift account/container/object -server.conf
68     type: boolean
69   MinPartHours:
70     type: number
71     default: 1
72     description: The minimum time (in hours) before a partition in a ring can be moved following a rebalance.
73   PartPower:
74     default: 10
75     description: Partition Power to use when building Swift rings
76     type: number
77   Replicas:
78     type: number
79     default: 3
80     description: How many replicas to use in the swift rings.
81   SnmpdReadonlyUserName:
82     default: ro_snmp_user
83     description: The user name for SNMPd with readonly rights running on all Overcloud nodes
84     type: string
85   SnmpdReadonlyUserPassword:
86     default: unset
87     description: The user password for SNMPd with readonly rights running on all Overcloud nodes
88     type: string
89     hidden: true
90   UpdateIdentifier:
91     default: ''
92     type: string
93     description: >
94       Setting to a previously unused value during stack-update will trigger
95       package update on all nodes
96   Hostname:
97     type: string
98     default: '' # Defaults to Heat created hostname
99
100 resources:
101   SwiftConfig:
102     type: OS::Heat::StructuredConfig
103     properties:
104       group: os-apply-config
105       config:
106         snmpd:
107           export_MIB: UCD-SNMP-MIB
108           readonly_user_name: {get_input: snmpd_readonly_user_name}
109           readonly_user_password: {get_input: snmpd_readonly_user_password}
110         swift:
111           hash: { get_input: swift_hash_suffix }
112           part-power: { get_input: swift_part_power }
113           min-part-hours: { get_input: swift_min_part_hours }
114           mount-check: { get_input: swift_mount_check }
115           replicas: {get_input: swift_replicas }
116         neutron:
117           ovs:
118             local_ip: { get_input: neutron_local_ip }
119   SwiftStorage:
120     type: OS::Nova::Server
121     properties:
122       image: {get_param: Image}
123       flavor: {get_param: Flavor}
124       key_name: {get_param: KeyName}
125       networks:
126         - network: ctlplane
127       user_data_format: SOFTWARE_CONFIG
128       user_data: {get_resource: NodeUserData}
129       name: {get_param: Hostname}
130
131   NodeUserData:
132     type: OS::TripleO::NodeUserData
133
134   InternalApiPort:
135     type: OS::TripleO::SwiftStorage::Ports::InternalApiPort
136     properties:
137       ControlPlaneIP: {get_attr: [SwiftStorage, networks, ctlplane, 0]}
138
139   StoragePort:
140     type: OS::TripleO::SwiftStorage::Ports::StoragePort
141     properties:
142       ControlPlaneIP: {get_attr: [SwiftStorage, networks, ctlplane, 0]}
143
144   StorageMgmtPort:
145     type: OS::TripleO::SwiftStorage::Ports::StorageMgmtPort
146     properties:
147       ControlPlaneIP: {get_attr: [SwiftStorage, networks, ctlplane, 0]}
148
149   NetworkConfig:
150     type: OS::TripleO::ObjectStorage::Net::SoftwareConfig
151     properties:
152       InternalApiIpSubnet: {get_attr: [InternalApiPort, ip_subnet]}
153       StorageIpSubnet: {get_attr: [StoragePort, ip_subnet]}
154       StorageMgmtIpSubnet: {get_attr: [StorageMgmtPort, ip_subnet]}
155
156   NetworkDeployment:
157     type: OS::TripleO::SoftwareDeployment
158     properties:
159       config: {get_resource: NetworkConfig}
160       server: {get_resource: SwiftStorage}
161
162   SwiftStorageDeploy:
163     type: OS::Heat::StructuredDeployment
164     properties:
165       server: {get_resource: SwiftStorage}
166       config: {get_resource: SwiftConfig}
167       signal_transport: NO_SIGNAL
168       input_values:
169         neutron_local_ip: {get_attr: [SwiftStorage, networks, ctlplane, 0]}
170         snmpd_readonly_user_name: {get_param: SnmpdReadonlyUserName}
171         snmpd_readonly_user_password: {get_param: SnmpdReadonlyUserPassword}
172         swift_hash_suffix: {get_param: HashSuffix}
173         swift_mount_check: {get_param: MountCheck}
174         swift_min_part_hours: {get_param: MinPartHours}
175         swift_part_power: {get_param: PartPower}
176         swift_replicas: { get_param: Replicas}
177
178 outputs:
179   hosts_entry:
180     value:
181       str_replace:
182         template: "IP HOST"
183         params:
184           IP: {get_attr: [SwiftStorage, networks, ctlplane, 0]}
185           HOST: {get_attr: [SwiftStorage, name]}
186   nova_server_resource:
187     description: Heat resource handle for the swift storage server
188     value:
189       {get_resource: SwiftStorage}
190   swift_device:
191     description: Swift device formatted for swift-ring-builder
192     value:
193       str_replace:
194         template: 'r1z1-IP:%PORT%/d1'
195         params:
196           IP: {get_attr: [SwiftStorage, networks, ctlplane, 0]}
197   internal_api_ip_address:
198     description: IP address of the server in the internal_api network
199     value: {get_attr: [InternalApiPort, ip_address]}
200   storage_ip_address:
201     description: IP address of the server in the storage network
202     value: {get_attr: [StoragePort, ip_address]}
203   storage_mgmt_ip_address:
204     description: IP address of the server in the storage_mgmt network
205     value: {get_attr: [StorageMgmtPort, ip_address]}
206   config_identifier:
207     description: identifier which changes if the node configuration may need re-applying
208     value: "None - NO_SIGNAL"