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