Merge "Make heat auth_encryption_key random"
[apex-tripleo-heat-templates.git] / puppet / cinder-storage-puppet.yaml
1 heat_template_version: 2014-10-16
2 description: 'Block Storage Configuration w/ 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   VirtualIP:
20     default: ''
21     type: string
22   ExtraConfig:
23     default: {}
24     description: |
25       Additional configuration to inject into the cluster. The JSON should have
26       the following structure:
27         {"FILEKEY":
28           {"config":
29             [{"section": "SECTIONNAME",
30               "values":
31                 [{"option": "OPTIONNAME",
32                   "value": "VALUENAME"
33                  }
34                 ]
35              }
36             ]
37           }
38         }
39       For instance:
40         {"nova":
41           {"config":
42             [{"section": "default",
43               "values":
44                 [{"option": "force_config_drive",
45                   "value": "always"
46                  }
47                 ]
48              },
49              {"section": "cells",
50               "values":
51                 [{"option": "driver",
52                   "value": "nova.cells.rpc_driver.CellsRPCDriver"
53                  }
54                 ]
55              }
56             ]
57           }
58         }
59     type: json
60   Flavor:
61     description: Flavor for block storage nodes to request when deploying.
62     type: string
63     constraints:
64       - custom_constraint: nova.flavor
65   GlancePort:
66     default: "9292"
67     description: Glance port.
68     type: string
69   KeyName:
70     default: default
71     description: Name of an existing EC2 KeyPair to enable SSH access to the instances
72     type: string
73   RabbitPassword:
74     default: ''
75     type: string
76   RabbitUserName:
77     default: ''
78     type: string
79   SnmpdReadonlyUserName:
80     default: ro_snmp_user
81     description: The user name for SNMPd with readonly rights running on all Overcloud nodes
82     type: string
83   SnmpdReadonlyUserPassword:
84     default: unset
85     description: The user password for SNMPd with readonly rights running on all Overcloud nodes
86     type: string
87     hidden: true
88   NtpServer:
89     type: string
90     default: ''
91   EnablePackageInstall:
92     default: 'false'
93     description: Set to true to enable package installation via Puppet
94     type: boolean
95
96 resources:
97   BlockStorage:
98     type: OS::Nova::Server
99     properties:
100       image:
101         {get_param: Image}
102       flavor: {get_param: Flavor}
103       key_name: {get_param: KeyName}
104       user_data_format: SOFTWARE_CONFIG
105       networks:
106         - network: ctlplane
107
108   BlockStorageDeployment:
109     type: OS::Heat::StructuredDeployment
110     properties:
111       server: {get_resource: BlockStorage}
112       config: {get_resource: BlockStorageConfig}
113       input_values:
114         cinder_dsn: {list_join: ['', ['mysql://cinder:unset@', {get_param: VirtualIP} , '/cinder']]}
115         snmpd_readonly_user_name: {get_param: SnmpdReadonlyUserName}
116         snmpd_readonly_user_password: {get_param: SnmpdReadonlyUserPassword}
117         cinder_lvm_loop_device_size:
118           str_replace:
119             template: sizeM
120             params:
121               size: {get_param: CinderLVMLoopDeviceSize}
122         cinder_enable_iscsi_backend: {get_param: CinderEnableIscsiBackend}
123         cinder_iscsi_helper: {get_param: CinderISCSIHelper}
124         rabbit_hosts:
125           str_replace:
126             template: '["host"]'
127             params:
128               host: {get_param: VirtualIP}
129         rabbit_username: {get_param: RabbitUserName}
130         rabbit_password: {get_param: RabbitPassword}
131         ntp_servers:
132           str_replace:
133             template: '["server"]'
134             params:
135               server: {get_param: NtpServer}
136         enable_package_install: {get_param: EnablePackageInstall}
137       signal_transport: NO_SIGNAL
138
139   # Map heat metadata into hiera datafiles
140   BlockStorageConfig:
141     type: OS::Heat::StructuredConfig
142     properties:
143       group: os-apply-config
144       config:
145         hiera:
146           hierarchy:
147             - heat_config_%{::deploy_config_name}
148             - volume
149             - common
150           datafiles:
151             common:
152               raw_data: {get_file: hieradata/common.yaml}
153             volume:
154               raw_data: {get_file: hieradata/volume.yaml}
155               oac_data:
156                 cinder_iscsi_ip_address: local-ipv4
157               mapped_data:
158                 # Cinder
159                 cinder::setup_test_volume::size: {get_input: cinder_lvm_loop_device_size}
160                 cinder_iscsi_helper: {get_input: cinder_iscsi_helper}
161                 cinder::database_connection: {get_input: cinder_dsn}
162                 cinder::rabbit_hosts: {get_input: rabbit_hosts}
163                 cinder::rabbit_userid: {get_input: rabbit_username}
164                 cinder::rabbit_password: {get_input: rabbit_password}
165                 cinder_enable_iscsi_backend: {get_input: cinder_enable_iscsi_backend}
166                 ntp::servers: {get_input: ntp_servers}
167                 enable_package_install: {get_input: enable_package_install}
168                 snmpd_readonly_user_name: {get_input: snmpd_readonly_user_name}
169                 snmpd_readonly_user_password: {get_input: snmpd_readonly_user_password}
170
171 outputs:
172   hosts_entry:
173     value:
174       str_replace:
175         template: "IP HOST HOST.novalocal"
176         params:
177           IP: {get_attr: [BlockStorage, networks, ctlplane, 0]}
178           HOST: {get_attr: [BlockStorage, name]}
179   nova_server_resource:
180     description: Heat resource handle for the block storage server
181     value:
182       {get_resource: BlockStorage}