|
9 | 9 | # Timeout when db connections should be reaped. |
10 | 10 | # (Optional) Defaults to 3600. |
11 | 11 | # |
| 12 | +# [*rabbit_use_ssl*] |
| 13 | +# (optional) Connect over SSL for RabbitMQ |
| 14 | +# Defaults to false |
| 15 | +# |
| 16 | +# [*kombu_ssl_ca_certs*] |
| 17 | +# (optional) SSL certification authority file (valid only if SSL enabled). |
| 18 | +# Defaults to undef |
| 19 | +# |
| 20 | +# [*kombu_ssl_certfile*] |
| 21 | +# (optional) SSL cert file (valid only if SSL enabled). |
| 22 | +# Defaults to undef |
| 23 | +# |
| 24 | +# [*kombu_ssl_keyfile*] |
| 25 | +# (optional) SSL key file (valid only if SSL enabled). |
| 26 | +# Defaults to undef |
| 27 | +# |
| 28 | +# [*kombu_ssl_version*] |
| 29 | +# (optional) SSL version to use (valid only if SSL enabled). |
| 30 | +# Valid values are TLSv1, SSLv23 and SSLv3. SSLv2 may be |
| 31 | +# available on some distributions. |
| 32 | +# Defaults to 'SSLv3' |
| 33 | +# |
12 | 34 | # [amqp_durable_queues] |
13 | 35 | # Use durable queues in amqp. |
14 | 36 | # (Optional) Defaults to false. |
|
63 | 85 | $rabbit_virtual_host = '/', |
64 | 86 | $rabbit_userid = 'guest', |
65 | 87 | $rabbit_password = false, |
| 88 | + $rabbit_use_ssl = false, |
| 89 | + $kombu_ssl_ca_certs = undef, |
| 90 | + $kombu_ssl_certfile = undef, |
| 91 | + $kombu_ssl_keyfile = undef, |
| 92 | + $kombu_ssl_version = 'SSLv3', |
66 | 93 | $amqp_durable_queues = false, |
67 | 94 | $qpid_hostname = 'localhost', |
68 | 95 | $qpid_port = '5672', |
|
123 | 150 | } |
124 | 151 | } |
125 | 152 |
|
| 153 | + if $rabbit_use_ssl { |
| 154 | + if !$kombu_ssl_ca_certs { |
| 155 | + fail('The kombu_ssl_ca_certs parameter is required when rabbit_use_ssl is set to true') |
| 156 | + } |
| 157 | + if !$kombu_ssl_certfile { |
| 158 | + fail('The kombu_ssl_certfile parameter is required when rabbit_use_ssl is set to true') |
| 159 | + } |
| 160 | + if !$kombu_ssl_keyfile { |
| 161 | + fail('The kombu_ssl_keyfile parameter is required when rabbit_use_ssl is set to true') |
| 162 | + } |
| 163 | + } |
| 164 | + |
126 | 165 | # this anchor is used to simplify the graph between cinder components by |
127 | 166 | # allowing a resource to serve as a point where the configuration of cinder begins |
128 | 167 | anchor { 'cinder-start': } |
|
159 | 198 | 'DEFAULT/rabbit_password': value => $rabbit_password, secret => true; |
160 | 199 | 'DEFAULT/rabbit_userid': value => $rabbit_userid; |
161 | 200 | 'DEFAULT/rabbit_virtual_host': value => $rabbit_virtual_host; |
| 201 | + 'DEFAULT/rabbit_use_ssl': value => $rabbit_use_ssl; |
162 | 202 | 'DEFAULT/control_exchange': value => $control_exchange; |
163 | 203 | 'DEFAULT/amqp_durable_queues': value => $amqp_durable_queues; |
164 | 204 | } |
|
172 | 212 | cinder_config { 'DEFAULT/rabbit_hosts': value => "${rabbit_host}:${rabbit_port}" } |
173 | 213 | cinder_config { 'DEFAULT/rabbit_ha_queues': value => false } |
174 | 214 | } |
| 215 | + |
| 216 | + if $rabbit_use_ssl { |
| 217 | + cinder_config { |
| 218 | + 'DEFAULT/kombu_ssl_ca_certs': value => $kombu_ssl_ca_certs; |
| 219 | + 'DEFAULT/kombu_ssl_certfile': value => $kombu_ssl_certfile; |
| 220 | + 'DEFAULT/kombu_ssl_keyfile': value => $kombu_ssl_keyfile; |
| 221 | + 'DEFAULT/kombu_ssl_version': value => $kombu_ssl_version; |
| 222 | + } |
| 223 | + } else { |
| 224 | + cinder_config { |
| 225 | + 'DEFAULT/kombu_ssl_ca_certs': ensure => absent; |
| 226 | + 'DEFAULT/kombu_ssl_certfile': ensure => absent; |
| 227 | + 'DEFAULT/kombu_ssl_keyfile': ensure => absent; |
| 228 | + 'DEFAULT/kombu_ssl_version': ensure => absent; |
| 229 | + } |
| 230 | + } |
| 231 | + |
175 | 232 | } |
176 | 233 |
|
177 | 234 | if $rpc_backend == 'cinder.openstack.common.rpc.impl_qpid' { |
|
0 commit comments