Merge "Drop swift ceilometer middleware for pacemaker"
[apex-tripleo-heat-templates.git] / puppet / cinder-storage-puppet.yaml
1 heat_template_version: 2015-04-30
2 description: 'OpenStack cinder storage configured by Puppet'
3 parameters:
4   Image:
5     default: overcloud-cinder-volume
6     type: string
7   CinderEnableIscsiBackend:
8     default: true
9     description: Whether to enable or not the Iscsi backend for Cinder
10     type: boolean
11   CinderISCSIHelper:
12     default: tgtadm
13     description: The iSCSI helper to use with cinder.
14     type: string
15   CinderLVMLoopDeviceSize:
16     default: 5000
17     description: The size of the loopback file used by the cinder LVM driver.
18     type: number
19   CinderPassword:
20     default: unset
21     description: The password for the cinder service and db account, used by cinder-api.
22     type: string
23     hidden: true
24   Debug:
25     default: ''
26     description: Set to True to enable debugging on all services.
27     type: string
28   VirtualIP: # deprecated. Use per service VIPs instead.
29     default: ''
30     type: string
31   ExtraConfig:
32     default: {}
33     description: |
34       Additional configuration to inject into the cluster. The JSON should have
35       the following structure:
36         {"FILEKEY":
37           {"config":
38             [{"section": "SECTIONNAME",
39               "values":
40                 [{"option": "OPTIONNAME",
41                   "value": "VALUENAME"
42                  }
43                 ]
44              }
45             ]
46           }
47         }
48       For instance:
49         {"nova":
50           {"config":
51             [{"section": "default",
52               "values":
53                 [{"option": "force_config_drive",
54                   "value": "always"
55                  }
56                 ]
57              },
58              {"section": "cells",
59               "values":
60                 [{"option": "driver",
61                   "value": "nova.cells.rpc_driver.CellsRPCDriver"
62                  }
63                 ]
64              }
65             ]
66           }
67         }
68     type: json
69   Flavor:
70     description: Flavor for block storage nodes to request when deploying.
71     type: string
72     constraints:
73       - custom_constraint: nova.flavor
74   GlancePort:
75     default: "9292"
76     description: Glance port.
77     type: string
78   GlanceProtocol:
79     default: http
80     description: Protocol to use when connecting to glance, set to https for SSL.
81     type: string
82   KeyName:
83     default: default
84     description: Name of an existing EC2 KeyPair to enable SSH access to the instances
85     type: string
86   RabbitPassword:
87     default: 'guest'
88     type: string
89   RabbitUserName:
90     default: 'guest'
91     type: string
92   RabbitClientUseSSL:
93     default: false
94     description: >
95         Rabbit client subscriber parameter to specify
96         an SSL connection to the RabbitMQ host.
97     type: string
98   RabbitClientPort:
99     default: 5672
100     description: Set rabbit subscriber port, change this if using SSL
101     type: number
102   SnmpdReadonlyUserName:
103     default: ro_snmp_user
104     description: The user name for SNMPd with readonly rights running on all Overcloud nodes
105     type: string
106   SnmpdReadonlyUserPassword:
107     default: unset
108     description: The user password for SNMPd with readonly rights running on all Overcloud nodes
109     type: string
110     hidden: true
111   NtpServer:
112     type: string
113     default: ''
114   EnablePackageInstall:
115     default: 'false'
116     description: Set to true to enable package installation via Puppet
117     type: boolean
118   UpdateIdentifier:
119     default: ''
120     type: string
121     description: >
122       Setting to a previously unused value during stack-update will trigger
123       package update on all nodes
124   Hostname:
125     type: string
126     default: '' # Defaults to Heat created hostname
127   ServiceNetMap:
128     default: {}
129     description: Mapping of service_name -> network name. Typically set
130                  via parameter_defaults in the resource registry.
131     type: json
132   GlanceApiVirtualIP:
133     type: string
134     default: ''
135   MysqlVirtualIP:
136     type: string
137     default: ''
138
139 resources:
140   BlockStorage:
141     type: OS::Nova::Server
142     properties:
143       image:
144         {get_param: Image}
145       flavor: {get_param: Flavor}
146       key_name: {get_param: KeyName}
147       networks:
148         - network: ctlplane
149       user_data_format: SOFTWARE_CONFIG
150       user_data: {get_resource: NodeUserData}
151       name: {get_param: Hostname}
152
153   NodeUserData:
154     type: OS::TripleO::NodeUserData
155
156   InternalApiPort:
157     type: OS::TripleO::BlockStorage::Ports::InternalApiPort
158     properties:
159       ControlPlaneIP: {get_attr: [BlockStorage, networks, ctlplane, 0]}
160
161   StoragePort:
162     type: OS::TripleO::BlockStorage::Ports::StoragePort
163     properties:
164       ControlPlaneIP: {get_attr: [BlockStorage, networks, ctlplane, 0]}
165
166   StorageMgmtPort:
167     type: OS::TripleO::BlockStorage::Ports::StorageMgmtPort
168     properties:
169       ControlPlaneIP: {get_attr: [BlockStorage, networks, ctlplane, 0]}
170
171   NetworkConfig:
172     type: OS::TripleO::BlockStorage::Net::SoftwareConfig
173     properties:
174       InternalApiIpSubnet: {get_attr: [InternalApiPort, ip_subnet]}
175       StorageIpSubnet: {get_attr: [StoragePort, ip_subnet]}
176       StorageMgmtIpSubnet: {get_attr: [StorageMgmtPort, ip_subnet]}
177
178   NetIpMap:
179     type: OS::TripleO::Network::Ports::NetIpMap
180     properties:
181       InternalApiIp: {get_attr: [InternalApiPort, ip_address]}
182       StorageIp: {get_attr: [StoragePort, ip_address]}
183       StorageMgmtIp: {get_attr: [StorageMgmtPort, ip_address]}
184
185   NetworkDeployment:
186     type: OS::TripleO::SoftwareDeployment
187     properties:
188       config: {get_resource: NetworkConfig}
189       server: {get_resource: BlockStorage}
190
191   BlockStorageDeployment:
192     type: OS::Heat::StructuredDeployment
193     depends_on: NetworkDeployment
194     properties:
195       server: {get_resource: BlockStorage}
196       config: {get_resource: BlockStorageConfig}
197       input_values:
198         debug: {get_param: Debug}
199         cinder_dsn: {list_join: ['', ['mysql://cinder:', {get_param: CinderPassword}, '@', {get_param: MysqlVirtualIP} , '/cinder']]}
200         snmpd_readonly_user_name: {get_param: SnmpdReadonlyUserName}
201         snmpd_readonly_user_password: {get_param: SnmpdReadonlyUserPassword}
202         cinder_lvm_loop_device_size:
203           str_replace:
204             template: sizeM
205             params:
206               size: {get_param: CinderLVMLoopDeviceSize}
207         cinder_enable_iscsi_backend: {get_param: CinderEnableIscsiBackend}
208         cinder_iscsi_helper: {get_param: CinderISCSIHelper}
209         cinder_iscsi_ip_address: {get_attr: [NetIpMap, net_ip_map, {get_param: [ServiceNetMap, CinderIscsiNetwork]}]}
210         glance_api_servers:
211           list_join:
212             - ''
213             - - {get_param: GlanceProtocol}
214               - '://'
215               - {get_param: GlanceApiVirtualIP}
216               - ':'
217               - {get_param: GlancePort}
218         rabbit_username: {get_param: RabbitUserName}
219         rabbit_password: {get_param: RabbitPassword}
220         rabbit_client_use_ssl: {get_param: RabbitClientUseSSL}
221         rabbit_client_port: {get_param: RabbitClientPort}
222         ntp_servers:
223           str_replace:
224             template: '["server"]'
225             params:
226               server: {get_param: NtpServer}
227         enable_package_install: {get_param: EnablePackageInstall}
228
229   # Map heat metadata into hiera datafiles
230   BlockStorageConfig:
231     type: OS::Heat::StructuredConfig
232     properties:
233       group: os-apply-config
234       config:
235         hiera:
236           hierarchy:
237             - heat_config_%{::deploy_config_name}
238             - volume
239             - all_nodes # provided by allNodesConfig
240             - '"%{::osfamily}"'
241             - common
242           datafiles:
243             common:
244               raw_data: {get_file: hieradata/common.yaml}
245             volume:
246               raw_data: {get_file: hieradata/volume.yaml}
247               mapped_data:
248                 # Cinder
249                 cinder::debug: {get_input: debug}
250                 cinder::setup_test_volume::size: {get_input: cinder_lvm_loop_device_size}
251                 cinder_iscsi_helper: {get_input: cinder_iscsi_helper}
252                 cinder::database_connection: {get_input: cinder_dsn}
253                 cinder::rabbit_userid: {get_input: rabbit_username}
254                 cinder::rabbit_password: {get_input: rabbit_password}
255                 cinder::rabbit_use_ssl: {get_input: rabbit_client_use_ssl}
256                 cinder::rabbit_port: {get_input: rabbit_client_port}
257                 cinder_enable_iscsi_backend: {get_input: cinder_enable_iscsi_backend}
258                 cinder_iscsi_ip_address: {get_input: cinder_iscsi_ip_address}
259                 cinder::glance::glance_api_servers: {get_input: glance_api_servers}
260                 ntp::servers: {get_input: ntp_servers}
261                 enable_package_install: {get_input: enable_package_install}
262                 snmpd_readonly_user_name: {get_input: snmpd_readonly_user_name}
263                 snmpd_readonly_user_password: {get_input: snmpd_readonly_user_password}
264
265   UpdateConfig:
266     type: OS::TripleO::Tasks::PackageUpdate
267
268   UpdateDeployment:
269     type: OS::Heat::SoftwareDeployment
270     properties:
271       config: {get_resource: UpdateConfig}
272       server: {get_resource: BlockStorage}
273       input_values:
274         update_identifier:
275           get_param: UpdateIdentifier
276
277 outputs:
278   hosts_entry:
279     value:
280       str_replace:
281         template: "IP HOST.localdomain HOST"
282         params:
283           IP: {get_attr: [BlockStorage, networks, ctlplane, 0]}
284           HOST: {get_attr: [BlockStorage, name]}
285   nova_server_resource:
286     description: Heat resource handle for the block storage server
287     value:
288       {get_resource: BlockStorage}
289   internal_api_ip_address:
290     description: IP address of the server in the internal_api network
291     value: {get_attr: [InternalApiPort, ip_address]}
292   storage_ip_address:
293     description: IP address of the server in the storage network
294     value: {get_attr: [StoragePort, ip_address]}
295   storage_mgmt_ip_address:
296     description: IP address of the server in the storage_mgmt network
297     value: {get_attr: [StorageMgmtPort, ip_address]}
298   config_identifier:
299     description: identifier which changes if the node configuration may need re-applying
300     value: {get_attr: [BlockStorageDeployment, deploy_stdout]}