Merge "Remove external bridge from Compute nodes"
[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:
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   KeyName:
79     default: default
80     description: Name of an existing EC2 KeyPair to enable SSH access to the instances
81     type: string
82   RabbitPassword:
83     default: 'guest'
84     type: string
85   RabbitUserName:
86     default: 'guest'
87     type: string
88   RabbitClientUseSSL:
89     default: false
90     description: >
91         Rabbit client subscriber parameter to specify
92         an SSL connection to the RabbitMQ host.
93     type: string
94   RabbitClientPort:
95     default: 5672
96     description: Set rabbit subscriber port, change this if using SSL
97     type: number
98   SnmpdReadonlyUserName:
99     default: ro_snmp_user
100     description: The user name for SNMPd with readonly rights running on all Overcloud nodes
101     type: string
102   SnmpdReadonlyUserPassword:
103     default: unset
104     description: The user password for SNMPd with readonly rights running on all Overcloud nodes
105     type: string
106     hidden: true
107   NtpServer:
108     type: string
109     default: ''
110   EnablePackageInstall:
111     default: 'false'
112     description: Set to true to enable package installation via Puppet
113     type: boolean
114   UpdateIdentifier:
115     default: ''
116     type: string
117     description: >
118       Setting to a previously unused value during stack-update will trigger
119       package update on all nodes
120
121 resources:
122   BlockStorage:
123     type: OS::Nova::Server
124     properties:
125       image:
126         {get_param: Image}
127       flavor: {get_param: Flavor}
128       key_name: {get_param: KeyName}
129       networks:
130         - network: ctlplane
131       user_data_format: SOFTWARE_CONFIG
132       user_data: {get_resource: NodeUserData}
133
134   NodeUserData:
135     type: OS::TripleO::NodeUserData
136
137   InternalApiPort:
138     type: OS::TripleO::BlockStorage::Ports::InternalApiPort
139     properties:
140       ControlPlaneIP: {get_attr: [BlockStorage, networks, ctlplane, 0]}
141
142   StoragePort:
143     type: OS::TripleO::BlockStorage::Ports::StoragePort
144     properties:
145       ControlPlaneIP: {get_attr: [BlockStorage, networks, ctlplane, 0]}
146
147   StorageMgmtPort:
148     type: OS::TripleO::BlockStorage::Ports::StorageMgmtPort
149     properties:
150       ControlPlaneIP: {get_attr: [BlockStorage, networks, ctlplane, 0]}
151
152   NetworkConfig:
153     type: OS::TripleO::BlockStorage::Net::SoftwareConfig
154     properties:
155       InternalApiIpSubnet: {get_attr: [InternalApiPort, ip_subnet]}
156       StorageIpSubnet: {get_attr: [StoragePort, ip_subnet]}
157       StorageMgmtIpSubnet: {get_attr: [StorageMgmtPort, ip_subnet]}
158
159   NetworkDeployment:
160     type: OS::TripleO::SoftwareDeployment
161     properties:
162       config: {get_resource: NetworkConfig}
163       server: {get_resource: BlockStorage}
164
165   BlockStorageDeployment:
166     type: OS::Heat::StructuredDeployment
167     properties:
168       server: {get_resource: BlockStorage}
169       config: {get_resource: BlockStorageConfig}
170       input_values:
171         debug: {get_param: Debug}
172         cinder_dsn: {list_join: ['', ['mysql://cinder:', {get_param: CinderPassword}, '@', {get_param: VirtualIP} , '/cinder']]}
173         snmpd_readonly_user_name: {get_param: SnmpdReadonlyUserName}
174         snmpd_readonly_user_password: {get_param: SnmpdReadonlyUserPassword}
175         cinder_lvm_loop_device_size:
176           str_replace:
177             template: sizeM
178             params:
179               size: {get_param: CinderLVMLoopDeviceSize}
180         cinder_enable_iscsi_backend: {get_param: CinderEnableIscsiBackend}
181         cinder_iscsi_helper: {get_param: CinderISCSIHelper}
182         rabbit_username: {get_param: RabbitUserName}
183         rabbit_password: {get_param: RabbitPassword}
184         rabbit_client_use_ssl: {get_param: RabbitClientUseSSL}
185         rabbit_client_port: {get_param: RabbitClientPort}
186         ntp_servers:
187           str_replace:
188             template: '["server"]'
189             params:
190               server: {get_param: NtpServer}
191         enable_package_install: {get_param: EnablePackageInstall}
192       signal_transport: NO_SIGNAL
193
194   # Map heat metadata into hiera datafiles
195   BlockStorageConfig:
196     type: OS::Heat::StructuredConfig
197     properties:
198       group: os-apply-config
199       config:
200         hiera:
201           hierarchy:
202             - heat_config_%{::deploy_config_name}
203             - volume
204             - all_nodes # provided by allNodesConfig
205             - '"%{::osfamily}"'
206             - common
207           datafiles:
208             common:
209               raw_data: {get_file: hieradata/common.yaml}
210             volume:
211               raw_data: {get_file: hieradata/volume.yaml}
212               oac_data:
213                 cinder_iscsi_ip_address: local-ipv4
214               mapped_data:
215                 # Cinder
216                 cinder::debug: {get_input: debug}
217                 cinder::setup_test_volume::size: {get_input: cinder_lvm_loop_device_size}
218                 cinder_iscsi_helper: {get_input: cinder_iscsi_helper}
219                 cinder::database_connection: {get_input: cinder_dsn}
220                 cinder::rabbit_userid: {get_input: rabbit_username}
221                 cinder::rabbit_password: {get_input: rabbit_password}
222                 cinder::rabbit_use_ssl: {get_input: rabbit_client_use_ssl}
223                 cinder::rabbit_port: {get_input: rabbit_client_port}
224                 cinder_enable_iscsi_backend: {get_input: cinder_enable_iscsi_backend}
225                 ntp::servers: {get_input: ntp_servers}
226                 enable_package_install: {get_input: enable_package_install}
227                 snmpd_readonly_user_name: {get_input: snmpd_readonly_user_name}
228                 snmpd_readonly_user_password: {get_input: snmpd_readonly_user_password}
229
230   UpdateConfig:
231     type: OS::TripleO::Tasks::PackageUpdate
232
233   UpdateDeployment:
234     type: OS::Heat::SoftwareDeployment
235     properties:
236       config: {get_resource: UpdateConfig}
237       server: {get_resource: BlockStorage}
238       input_values:
239         update_identifier:
240           get_param: UpdateIdentifier
241
242 outputs:
243   hosts_entry:
244     value:
245       str_replace:
246         template: "IP HOST"
247         params:
248           IP: {get_attr: [BlockStorage, networks, ctlplane, 0]}
249           HOST: {get_attr: [BlockStorage, name]}
250   nova_server_resource:
251     description: Heat resource handle for the block storage server
252     value:
253       {get_resource: BlockStorage}
254   internal_api_ip_address:
255     description: IP address of the server in the internal_api network
256     value: {get_attr: [InternalApiPort, ip_address]}
257   storage_ip_address:
258     description: IP address of the server in the storage network
259     value: {get_attr: [StoragePort, ip_address]}
260   storage_mgmt_ip_address:
261     description: IP address of the server in the storage_mgmt network
262     value: {get_attr: [StorageMgmtPort, ip_address]}