| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 240b119 commit 308d098
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,6 +9,28 @@ | |||
| 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,6 +85,11 @@ | |||
| 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,6 +150,18 @@ | |||
| 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,6 +198,7 @@ | |||
| 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,6 +212,23 @@ | |||
| 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' { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -178,6 +178,46 @@ | |||
| 178 | 178 | it { should contain_cinder_config('DEFAULT/qpid_sasl_mechanisms').with_value('DIGEST-MD5 GSSAPI PLAIN') } | |
| 179 | 179 | end | |
| 180 | 180 | ||
| 181 | + describe 'with SSL enabled' do | ||
| 182 | + let :params do | ||
| 183 | + req_params.merge!({ | ||
| 184 | + :rabbit_use_ssl => true, | ||
| 185 | + :kombu_ssl_ca_certs => '/path/to/ssl/ca/certs', | ||
| 186 | + :kombu_ssl_certfile => '/path/to/ssl/cert/file', | ||
| 187 | + :kombu_ssl_keyfile => '/path/to/ssl/keyfile', | ||
| 188 | + :kombu_ssl_version => 'SSLv3' | ||
| 189 | + }) | ||
| 190 | + end | ||
| 191 | + | ||
| 192 | + it do | ||
| 193 | + should contain_cinder_config('DEFAULT/rabbit_use_ssl').with_value('true') | ||
| 194 | + should contain_cinder_config('DEFAULT/kombu_ssl_ca_certs').with_value('/path/to/ssl/ca/certs') | ||
| 195 | + should contain_cinder_config('DEFAULT/kombu_ssl_certfile').with_value('/path/to/ssl/cert/file') | ||
| 196 | + should contain_cinder_config('DEFAULT/kombu_ssl_keyfile').with_value('/path/to/ssl/keyfile') | ||
| 197 | + should contain_cinder_config('DEFAULT/kombu_ssl_version').with_value('SSLv3') | ||
| 198 | + end | ||
| 199 | + end | ||
| 200 | + | ||
| 201 | + describe 'with SSL disabled' do | ||
| 202 | + let :params do | ||
| 203 | + req_params.merge!({ | ||
| 204 | + :rabbit_use_ssl => false, | ||
| 205 | + :kombu_ssl_ca_certs => 'undef', | ||
| 206 | + :kombu_ssl_certfile => 'undef', | ||
| 207 | + :kombu_ssl_keyfile => 'undef', | ||
| 208 | + :kombu_ssl_version => 'SSLv3' | ||
| 209 | + }) | ||
| 210 | + end | ||
| 211 | + | ||
| 212 | + it do | ||
| 213 | + should contain_cinder_config('DEFAULT/rabbit_use_ssl').with_value('false') | ||
| 214 | + should contain_cinder_config('DEFAULT/kombu_ssl_ca_certs').with_ensure('absent') | ||
| 215 | + should contain_cinder_config('DEFAULT/kombu_ssl_certfile').with_ensure('absent') | ||
| 216 | + should contain_cinder_config('DEFAULT/kombu_ssl_keyfile').with_ensure('absent') | ||
| 217 | + should contain_cinder_config('DEFAULT/kombu_ssl_version').with_ensure('absent') | ||
| 218 | + end | ||
| 219 | + end | ||
| 220 | + | ||
| 181 | 221 | describe 'with syslog disabled' do | |
| 182 | 222 | let :params do | |
| 183 | 223 | req_params | |
| Back | FazBrowse Home | New Git URL |
0 commit comments