Ensure all Rabbit params are propagated to interested nodes.
[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   RabbitClientUseSSL:
80     default: false
81     description: >
82         Rabbit client subscriber parameter to specify
83         an SSL connection to the RabbitMQ host.
84     type: string
85   RabbitClientPort:
86     default: 5672
87     description: Set rabbit subscriber port, change this if using SSL
88     type: number
89   SnmpdReadonlyUserName:
90     default: ro_snmp_user
91     description: The user name for SNMPd with readonly rights running on all Overcloud nodes
92     type: string
93   SnmpdReadonlyUserPassword:
94     default: unset
95     description: The user password for SNMPd with readonly rights running on all Overcloud nodes
96     type: string
97     hidden: true
98   NtpServer:
99     type: string
100     default: ''
101   EnablePackageInstall:
102     default: 'false'
103     description: Set to true to enable package installation via Puppet
104     type: boolean
105
106 resources:
107   BlockStorage:
108     type: OS::Nova::Server
109     properties:
110       image:
111         {get_param: Image}
112       flavor: {get_param: Flavor}
113       key_name: {get_param: KeyName}
114       user_data_format: SOFTWARE_CONFIG
115       networks:
116         - network: ctlplane
117
118   BlockStorageDeployment:
119     type: OS::Heat::StructuredDeployment
120     properties:
121       server: {get_resource: BlockStorage}
122       config: {get_resource: BlockStorageConfig}
123       input_values:
124         cinder_dsn: {list_join: ['', ['mysql://cinder:unset@', {get_param: VirtualIP} , '/cinder']]}
125         snmpd_readonly_user_name: {get_param: SnmpdReadonlyUserName}
126         snmpd_readonly_user_password: {get_param: SnmpdReadonlyUserPassword}
127         cinder_lvm_loop_device_size:
128           str_replace:
129             template: sizeM
130             params:
131               size: {get_param: CinderLVMLoopDeviceSize}
132         cinder_enable_iscsi_backend: {get_param: CinderEnableIscsiBackend}
133         cinder_iscsi_helper: {get_param: CinderISCSIHelper}
134         rabbit_hosts:
135           str_replace:
136             template: '["host"]'
137             params:
138               host: {get_param: VirtualIP}
139         rabbit_username: {get_param: RabbitUserName}
140         rabbit_password: {get_param: RabbitPassword}
141         rabbit_client_use_ssl: {get_param: RabbitClientUseSSL}
142         rabbit_client_port: {get_param: RabbitClientPort}
143         ntp_servers:
144           str_replace:
145             template: '["server"]'
146             params:
147               server: {get_param: NtpServer}
148         enable_package_install: {get_param: EnablePackageInstall}
149       signal_transport: NO_SIGNAL
150
151   # Map heat metadata into hiera datafiles
152   BlockStorageConfig:
153     type: OS::Heat::StructuredConfig
154     properties:
155       group: os-apply-config
156       config:
157         hiera:
158           hierarchy:
159             - heat_config_%{::deploy_config_name}
160             - volume
161             - common
162           datafiles:
163             common:
164               raw_data: {get_file: hieradata/common.yaml}
165             volume:
166               raw_data: {get_file: hieradata/volume.yaml}
167               oac_data:
168                 cinder_iscsi_ip_address: local-ipv4
169               mapped_data:
170                 # Cinder
171                 cinder::setup_test_volume::size: {get_input: cinder_lvm_loop_device_size}
172                 cinder_iscsi_helper: {get_input: cinder_iscsi_helper}
173                 cinder::database_connection: {get_input: cinder_dsn}
174                 cinder::rabbit_hosts: {get_input: rabbit_hosts}
175                 cinder::rabbit_userid: {get_input: rabbit_username}
176                 cinder::rabbit_password: {get_input: rabbit_password}
177                 cinder::rabbit_use_ssl: {get_input: rabbit_client_use_ssl}
178                 cinder::rabbit_port: {get_input: rabbit_client_port}
179                 cinder_enable_iscsi_backend: {get_input: cinder_enable_iscsi_backend}
180                 ntp::servers: {get_input: ntp_servers}
181                 enable_package_install: {get_input: enable_package_install}
182                 snmpd_readonly_user_name: {get_input: snmpd_readonly_user_name}
183                 snmpd_readonly_user_password: {get_input: snmpd_readonly_user_password}
184
185 outputs:
186   hosts_entry:
187     value:
188       str_replace:
189         template: "IP HOST HOST.novalocal"
190         params:
191           IP: {get_attr: [BlockStorage, networks, ctlplane, 0]}
192           HOST: {get_attr: [BlockStorage, name]}
193   nova_server_resource:
194     description: Heat resource handle for the block storage server
195     value:
196       {get_resource: BlockStorage}