| 1 |
# -*- coding: utf-8 -*- |
| 2 |
# Copyright (C) iWeb Technologies Inc. |
| 3 |
# |
| 4 |
# Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 |
# you may not use this file except in compliance with the License. |
| 6 |
# You may obtain a copy of the License at |
| 7 |
# |
| 8 |
# http://www.apache.org/licenses/LICENSE-2.0 |
| 9 |
# |
| 10 |
# Unless required by applicable law or agreed to in writing, software |
| 11 |
# distributed under the License is distributed on an "AS IS" BASIS, |
| 12 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 |
# See the License for the specific language governing permissions and |
| 14 |
# limitations under the License. |
| 15 |
# |
| 16 |
# Author: Francois Charlier <[email protected]> |
| 17 |
# Author: David Moreau Simard <[email protected]> |
| 18 |
# Author: Andrew Woodward <xarses> |
| 19 |
|
| 20 |
require 'spec_helper' |
| 21 |
|
| 22 |
describe 'ceph::repo' do |
| 23 |
shared_examples 'ceph::repo on Debian' do |
| 24 |
before do |
| 25 |
facts.merge!( :osfamily => 'Debian', |
| 26 |
:lsbdistid => 'Debian', |
| 27 |
:lsbdistcodename => 'jessie', |
| 28 |
:lsbdistrelease => '8' ) |
| 29 |
end |
| 30 |
|
| 31 |
context 'with default params' do |
| 32 |
it { should contain_apt__key('ceph').with( |
| 33 |
:id => '08B73419AC32B4E966C1A330E84AC2C0460F3994', |
| 34 |
:source => 'https://download.ceph.com/keys/release.asc', |
| 35 |
:before => 'Apt::Source[ceph]', |
| 36 |
)} |
| 37 |
|
| 38 |
it { should contain_apt__source('ceph').with( |
| 39 |
:location => 'http://download.ceph.com/debian-nautilus/', |
| 40 |
:release => 'jessie', |
| 41 |
)} |
| 42 |
end |
| 43 |
|
| 44 |
context 'when overriding ceph mirror' do |
| 45 |
let :params do |
| 46 |
{ |
| 47 |
:ceph_mirror => 'http://myserver.com/debian-nautilus/' |
| 48 |
} |
| 49 |
end |
| 50 |
|
| 51 |
it { should contain_apt__source('ceph').with( |
| 52 |
:location => 'http://myserver.com/debian-nautilus/', |
| 53 |
:release => 'jessie', |
| 54 |
)} |
| 55 |
end |
| 56 |
|
| 57 |
context 'when overriding ceph release' do |
| 58 |
let :params do |
| 59 |
{ |
| 60 |
:release => 'firefly' |
| 61 |
} |
| 62 |
end |
| 63 |
|
| 64 |
it { should contain_apt__source('ceph').with( |
| 65 |
:location => 'http://download.ceph.com/debian-firefly/', |
| 66 |
:release => 'jessie', |
| 67 |
)} |
| 68 |
end |
| 69 |
end |
| 70 |
|
| 71 |
shared_examples 'ceph::repo on Ubuntu' do |
| 72 |
before do |
| 73 |
facts.merge!( :osfamily => 'Debian', |
| 74 |
:lsbdistid => 'Ubuntu', |
| 75 |
:lsbdistcodename => 'trusty', |
| 76 |
:lsbdistrelease => '14.04', |
| 77 |
:hardwaremodel => 'x86_64' ) |
| 78 |
end |
| 79 |
|
| 80 |
context 'with default params' do |
| 81 |
it { should contain_apt__key('ceph').with( |
| 82 |
:id => '08B73419AC32B4E966C1A330E84AC2C0460F3994', |
| 83 |
:source => 'https://download.ceph.com/keys/release.asc', |
| 84 |
:before => 'Apt::Source[ceph]', |
| 85 |
)} |
| 86 |
|
| 87 |
it { should contain_apt__source('ceph').with( |
| 88 |
:location => 'http://download.ceph.com/debian-nautilus/', |
| 89 |
:release => 'trusty', |
| 90 |
)} |
| 91 |
end |
| 92 |
|
| 93 |
context 'when overriding ceph release' do |
| 94 |
let :params do |
| 95 |
{ |
| 96 |
:release => 'firefly' |
| 97 |
} |
| 98 |
end |
| 99 |
|
| 100 |
it { should contain_apt__source('ceph').with( |
| 101 |
:location => 'http://download.ceph.com/debian-firefly/', |
| 102 |
:release => 'trusty', |
| 103 |
)} |
| 104 |
end |
| 105 |
|
| 106 |
context 'when wanting fast-cgi' do |
| 107 |
let :params do |
| 108 |
{ |
| 109 |
:fastcgi => true |
| 110 |
} |
| 111 |
end |
| 112 |
|
| 113 |
it { should contain_apt__key('ceph-gitbuilder').with( |
| 114 |
:id => 'FCC5CB2ED8E6F6FB79D5B3316EAEAE2203C3951A', |
| 115 |
:server => 'keyserver.ubuntu.com', |
| 116 |
)} |
| 117 |
|
| 118 |
it { should contain_apt__source('ceph').with( |
| 119 |
:location => 'http://download.ceph.com/debian-nautilus/', |
| 120 |
:release => 'trusty', |
| 121 |
)} |
| 122 |
|
| 123 |
it { should contain_apt__source('ceph-fastcgi').with( |
| 124 |
:ensure => 'present', |
| 125 |
:location => 'http://gitbuilder.ceph.com/libapache-mod-fastcgi-deb-trusty-x86_64-basic/ref/master', |
| 126 |
:release => 'trusty', |
| 127 |
:require => 'Apt::Key[ceph-gitbuilder]' |
| 128 |
)} |
| 129 |
end |
| 130 |
|
| 131 |
context 'with ensure => absent to disable' do |
| 132 |
let :params do |
| 133 |
{ |
| 134 |
:ensure => 'absent', |
| 135 |
:fastcgi => true |
| 136 |
} |
| 137 |
end |
| 138 |
|
| 139 |
it { should contain_apt__source('ceph').with( |
| 140 |
:ensure => 'absent', |
| 141 |
:location => 'http://download.ceph.com/debian-nautilus/', |
| 142 |
:release => 'trusty', |
| 143 |
)} |
| 144 |
|
| 145 |
it { should contain_apt__source('ceph-fastcgi').with( |
| 146 |
:ensure => 'absent', |
| 147 |
:location => 'http://gitbuilder.ceph.com/libapache-mod-fastcgi-deb-trusty-x86_64-basic/ref/master', |
| 148 |
:release => 'trusty', |
| 149 |
:require => 'Apt::Key[ceph-gitbuilder]' |
| 150 |
)} |
| 151 |
end |
| 152 |
end |
| 153 |
|
| 154 |
shared_examples 'ceph::repo on RHEL' do |
| 155 |
before do |
| 156 |
facts.merge!( :osfamily => 'RedHat', |
| 157 |
:operatingsystem => 'RedHat', |
| 158 |
:operatingsystemmajrelease => '7' ) |
| 159 |
end |
| 160 |
|
| 161 |
context 'with default params' do |
| 162 |
it { should contain_yumrepo('ext-epel-7').with( |
| 163 |
:enabled => '1', |
| 164 |
:descr => 'External EPEL 7', |
| 165 |
:name => 'ext-epel-7', |
| 166 |
:baseurl => 'absent', |
| 167 |
:gpgcheck => '1', |
| 168 |
:gpgkey => 'https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7', |
| 169 |
:mirrorlist => 'http://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch', |
| 170 |
:priority => '20', |
| 171 |
:exclude => 'python-ceph-compat python-rbd python-rados python-cephfs', |
| 172 |
)} |
| 173 |
|
| 174 |
it { should contain_yumrepo('ext-ceph').with( |
| 175 |
:enabled => '1', |
| 176 |
:descr => 'External Ceph nautilus', |
| 177 |
:name => 'ext-ceph-nautilus', |
| 178 |
:baseurl => 'http://download.ceph.com/rpm-nautilus/el7/$basearch', |
| 179 |
:gpgcheck => '1', |
| 180 |
:gpgkey => 'https://download.ceph.com/keys/release.asc', |
| 181 |
:mirrorlist => 'absent', |
| 182 |
:priority => '10' |
| 183 |
)} |
| 184 |
|
| 185 |
it { should contain_yumrepo('ext-ceph-noarch').with( |
| 186 |
:enabled => '1', |
| 187 |
:descr => 'External Ceph noarch', |
| 188 |
:name => 'ext-ceph-nautilus-noarch', |
| 189 |
:baseurl => 'http://download.ceph.com/rpm-nautilus/el7/noarch', |
| 190 |
:gpgcheck => '1', |
| 191 |
:gpgkey => 'https://download.ceph.com/keys/release.asc', |
| 192 |
:mirrorlist => 'absent', |
| 193 |
:priority => '10' |
| 194 |
)} |
| 195 |
end |
| 196 |
|
| 197 |
context 'when overriding ceph release' do |
| 198 |
let :params do |
| 199 |
{ |
| 200 |
:release => 'firefly' |
| 201 |
} |
| 202 |
end |
| 203 |
|
| 204 |
it { should contain_yumrepo('ext-epel-7').with( |
| 205 |
:enabled => '1', |
| 206 |
:descr => 'External EPEL 7', |
| 207 |
:name => 'ext-epel-7', |
| 208 |
:baseurl => 'absent', |
| 209 |
:gpgcheck => '1', |
| 210 |
:gpgkey => 'https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7', |
| 211 |
:mirrorlist => 'http://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch', |
| 212 |
:priority => '20', |
| 213 |
:exclude => 'python-ceph-compat python-rbd python-rados python-cephfs', |
| 214 |
)} |
| 215 |
|
| 216 |
it { should contain_yumrepo('ext-ceph').with( |
| 217 |
:enabled => '1', |
| 218 |
:descr => 'External Ceph firefly', |
| 219 |
:name => 'ext-ceph-firefly', |
| 220 |
:baseurl => 'http://download.ceph.com/rpm-firefly/el7/$basearch', |
| 221 |
:gpgcheck => '1', |
| 222 |
:gpgkey => 'https://download.ceph.com/keys/release.asc', |
| 223 |
:mirrorlist => 'absent', |
| 224 |
:priority => '10' |
| 225 |
)} |
| 226 |
|
| 227 |
it { should contain_yumrepo('ext-ceph-noarch').with( |
| 228 |
:enabled => '1', |
| 229 |
:descr => 'External Ceph noarch', |
| 230 |
:name => 'ext-ceph-firefly-noarch', |
| 231 |
:baseurl => 'http://download.ceph.com/rpm-firefly/el7/noarch', |
| 232 |
:gpgcheck => '1', |
| 233 |
:gpgkey => 'https://download.ceph.com/keys/release.asc', |
| 234 |
:mirrorlist => 'absent', |
| 235 |
:priority => '10' |
| 236 |
)} |
| 237 |
end |
| 238 |
|
| 239 |
context 'when disabling EPEL' do |
| 240 |
let :params do |
| 241 |
{ |
| 242 |
:enable_epel => false, |
| 243 |
} |
| 244 |
end |
| 245 |
|
| 246 |
it { should_not contain_yumrepo('ext-epel-7') } |
| 247 |
end |
| 248 |
|
| 249 |
context 'when using a proxy for yum repositories' do |
| 250 |
let :params do |
| 251 |
{ |
| 252 |
:proxy => 'http://someproxy.com:8080/', |
| 253 |
:proxy_username => 'proxyuser', |
| 254 |
:proxy_password => 'proxypassword' |
| 255 |
} |
| 256 |
end |
| 257 |
|
| 258 |
it { should contain_yumrepo('ext-epel-7').with( |
| 259 |
:enabled => '1', |
| 260 |
:descr => 'External EPEL 7', |
| 261 |
:name => 'ext-epel-7', |
| 262 |
:baseurl => 'absent', |
| 263 |
:gpgcheck => '1', |
| 264 |
:gpgkey => 'https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7', |
| 265 |
:mirrorlist => 'http://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch', |
| 266 |
:priority => '20', |
| 267 |
:exclude => 'python-ceph-compat python-rbd python-rados python-cephfs', |
| 268 |
:proxy => 'http://someproxy.com:8080/', |
| 269 |
:proxy_username => 'proxyuser', |
| 270 |
:proxy_password => 'proxypassword', |
| 271 |
)} |
| 272 |
|
| 273 |
it { should contain_yumrepo('ext-ceph').with( |
| 274 |
:enabled => '1', |
| 275 |
:descr => 'External Ceph nautilus', |
| 276 |
:name => 'ext-ceph-nautilus', |
| 277 |
:baseurl => 'http://download.ceph.com/rpm-nautilus/el7/$basearch', |
| 278 |
:gpgcheck => '1', |
| 279 |
:gpgkey => 'https://download.ceph.com/keys/release.asc', |
| 280 |
:mirrorlist => 'absent', |
| 281 |
:priority => '10', |
| 282 |
:proxy => 'http://someproxy.com:8080/', |
| 283 |
:proxy_username => 'proxyuser', |
| 284 |
:proxy_password => 'proxypassword', |
| 285 |
)} |
| 286 |
|
| 287 |
it { should contain_yumrepo('ext-ceph-noarch').with( |
| 288 |
:enabled => '1', |
| 289 |
:descr => 'External Ceph noarch', |
| 290 |
:name => 'ext-ceph-nautilus-noarch', |
| 291 |
:baseurl => 'http://download.ceph.com/rpm-nautilus/el7/noarch', |
| 292 |
:gpgcheck => '1', |
| 293 |
:gpgkey => 'https://download.ceph.com/keys/release.asc', |
| 294 |
:mirrorlist => 'absent', |
| 295 |
:priority => '10', |
| 296 |
:proxy => 'http://someproxy.com:8080/', |
| 297 |
:proxy_username => 'proxyuser', |
| 298 |
:proxy_password => 'proxypassword', |
| 299 |
)} |
| 300 |
end |
| 301 |
|
| 302 |
context 'with ensure => absent to disable' do |
| 303 |
let :params do |
| 304 |
{ |
| 305 |
:ensure => 'absent', |
| 306 |
:fastcgi => true |
| 307 |
} |
| 308 |
end |
| 309 |
|
| 310 |
it { should contain_yumrepo('ext-epel-7').with( |
| 311 |
:enabled => '0', |
| 312 |
:descr => 'External EPEL 7', |
| 313 |
:name => 'ext-epel-7', |
| 314 |
:baseurl => 'absent', |
| 315 |
:gpgcheck => '1', |
| 316 |
:gpgkey => 'https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7', |
| 317 |
:mirrorlist => 'http://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch', |
| 318 |
:priority => '20', |
| 319 |
:exclude => 'python-ceph-compat python-rbd python-rados python-cephfs', |
| 320 |
)} |
| 321 |
|
| 322 |
it { should contain_yumrepo('ext-ceph').with( |
| 323 |
:enabled => '0', |
| 324 |
:descr => 'External Ceph nautilus', |
| 325 |
:name => 'ext-ceph-nautilus', |
| 326 |
:baseurl => 'http://download.ceph.com/rpm-nautilus/el7/$basearch', |
| 327 |
:gpgcheck => '1', |
| 328 |
:gpgkey => 'https://download.ceph.com/keys/release.asc', |
| 329 |
:mirrorlist => 'absent', |
| 330 |
:priority => '10' |
| 331 |
)} |
| 332 |
|
| 333 |
it { should contain_yumrepo('ext-ceph-noarch').with( |
| 334 |
:enabled => '0', |
| 335 |
:descr => 'External Ceph noarch', |
| 336 |
:name => 'ext-ceph-nautilus-noarch', |
| 337 |
:baseurl => 'http://download.ceph.com/rpm-nautilus/el7/noarch', |
| 338 |
:gpgcheck => '1', |
| 339 |
:gpgkey => 'https://download.ceph.com/keys/release.asc', |
| 340 |
:mirrorlist => 'absent', |
| 341 |
:priority => '10' |
| 342 |
)} |
| 343 |
|
| 344 |
it { should contain_yumrepo('ext-ceph-fastcgi').with( |
| 345 |
:enabled => '0', |
| 346 |
:descr => 'FastCGI basearch packages for Ceph', |
| 347 |
:name => 'ext-ceph-fastcgi', |
| 348 |
:baseurl => 'http://gitbuilder.ceph.com/mod_fastcgi-rpm-rhel7-x86_64-basic/ref/master', |
| 349 |
:gpgcheck => '1', |
| 350 |
:gpgkey => 'https://download.ceph.com/keys/autobuild.asc', |
| 351 |
:mirrorlist => 'absent', |
| 352 |
:priority => '20' |
| 353 |
)} |
| 354 |
end |
| 355 |
|
| 356 |
context 'with ceph fast-cgi' do |
| 357 |
let :params do |
| 358 |
{ |
| 359 |
:fastcgi => true |
| 360 |
} |
| 361 |
end |
| 362 |
|
| 363 |
it { should contain_yumrepo('ext-epel-7').with( |
| 364 |
:enabled => '1', |
| 365 |
:descr => 'External EPEL 7', |
| 366 |
:name => 'ext-epel-7', |
| 367 |
:baseurl => 'absent', |
| 368 |
:gpgcheck => '1', |
| 369 |
:gpgkey => 'https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7', |
| 370 |
:mirrorlist => 'http://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch', |
| 371 |
:priority => '20', |
| 372 |
:exclude => 'python-ceph-compat python-rbd python-rados python-cephfs', |
| 373 |
)} |
| 374 |
|
| 375 |
it { should contain_yumrepo('ext-ceph').with( |
| 376 |
:enabled => '1', |
| 377 |
:descr => 'External Ceph nautilus', |
| 378 |
:name => 'ext-ceph-nautilus', |
| 379 |
:baseurl => 'http://download.ceph.com/rpm-nautilus/el7/$basearch', |
| 380 |
:gpgcheck => '1', |
| 381 |
:gpgkey => 'https://download.ceph.com/keys/release.asc', |
| 382 |
:mirrorlist => 'absent', |
| 383 |
:priority => '10' |
| 384 |
)} |
| 385 |
|
| 386 |
it { should contain_yumrepo('ext-ceph-noarch').with( |
| 387 |
:enabled => '1', |
| 388 |
:descr => 'External Ceph noarch', |
| 389 |
:name => 'ext-ceph-nautilus-noarch', |
| 390 |
:baseurl => 'http://download.ceph.com/rpm-nautilus/el7/noarch', |
| 391 |
:gpgcheck => '1', |
| 392 |
:gpgkey => 'https://download.ceph.com/keys/release.asc', |
| 393 |
:mirrorlist => 'absent', |
| 394 |
:priority => '10' |
| 395 |
)} |
| 396 |
|
| 397 |
it { should contain_yumrepo('ext-ceph-fastcgi').with( |
| 398 |
:enabled => '1', |
| 399 |
:descr => 'FastCGI basearch packages for Ceph', |
| 400 |
:name => 'ext-ceph-fastcgi', |
| 401 |
:baseurl => 'http://gitbuilder.ceph.com/mod_fastcgi-rpm-rhel7-x86_64-basic/ref/master', |
| 402 |
:gpgcheck => '1', |
| 403 |
:gpgkey => 'https://download.ceph.com/keys/autobuild.asc', |
| 404 |
:mirrorlist => 'absent', |
| 405 |
:priority => '20' |
| 406 |
)} |
| 407 |
end |
| 408 |
end |
| 409 |
|
| 410 |
shared_examples 'ceph::repo on CentOS' do |
| 411 |
before do |
| 412 |
facts.merge!( :osfamily => 'RedHat', |
| 413 |
:operatingsystem => 'CentOS', |
| 414 |
:operatingsystemmajrelease => '7' ) |
| 415 |
end |
| 416 |
|
| 417 |
context 'with default params' do |
| 418 |
it { should contain_yumrepo('ext-epel-7').with( |
| 419 |
:enabled => '1', |
| 420 |
:descr => 'External EPEL 7', |
| 421 |
:name => 'ext-epel-7', |
| 422 |
:baseurl => 'absent', |
| 423 |
:gpgcheck => '1', |
| 424 |
:gpgkey => 'https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7', |
| 425 |
:mirrorlist => 'http://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch', |
| 426 |
:priority => '20', |
| 427 |
:exclude => 'python-ceph-compat python-rbd python-rados python-cephfs', |
| 428 |
)} |
| 429 |
|
| 430 |
it { should contain_yumrepo('ext-ceph').with( |
| 431 |
:enabled => '1', |
| 432 |
:descr => 'External Ceph nautilus', |
| 433 |
:name => 'ext-ceph-nautilus', |
| 434 |
:baseurl => 'http://download.ceph.com/rpm-nautilus/el7/$basearch', |
| 435 |
:gpgcheck => '1', |
| 436 |
:gpgkey => 'https://download.ceph.com/keys/release.asc', |
| 437 |
:mirrorlist => 'absent', |
| 438 |
:priority => '10' |
| 439 |
)} |
| 440 |
|
| 441 |
it { should contain_yumrepo('ext-ceph-noarch').with( |
| 442 |
:enabled => '1', |
| 443 |
:descr => 'External Ceph noarch', |
| 444 |
:name => 'ext-ceph-nautilus-noarch', |
| 445 |
:baseurl => 'http://download.ceph.com/rpm-nautilus/el7/noarch', |
| 446 |
:gpgcheck => '1', |
| 447 |
:gpgkey => 'https://download.ceph.com/keys/release.asc', |
| 448 |
:mirrorlist => 'absent', |
| 449 |
:priority => '10' |
| 450 |
)} |
| 451 |
end |
| 452 |
|
| 453 |
context 'when overriding ceph release' do |
| 454 |
let :params do |
| 455 |
{ |
| 456 |
:release => 'firefly' |
| 457 |
} |
| 458 |
end |
| 459 |
|
| 460 |
it { should contain_yumrepo('ext-epel-7').with( |
| 461 |
:enabled => '1', |
| 462 |
:descr => 'External EPEL 7', |
| 463 |
:name => 'ext-epel-7', |
| 464 |
:baseurl => 'absent', |
| 465 |
:gpgcheck => '1', |
| 466 |
:gpgkey => 'https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7', |
| 467 |
:mirrorlist => 'http://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch', |
| 468 |
:priority => '20', |
| 469 |
:exclude => 'python-ceph-compat python-rbd python-rados python-cephfs', |
| 470 |
)} |
| 471 |
|
| 472 |
it { should contain_yumrepo('ext-ceph').with( |
| 473 |
:enabled => '1', |
| 474 |
:descr => 'External Ceph firefly', |
| 475 |
:name => 'ext-ceph-firefly', |
| 476 |
:baseurl => 'http://download.ceph.com/rpm-firefly/el7/$basearch', |
| 477 |
:gpgcheck => '1', |
| 478 |
:gpgkey => 'https://download.ceph.com/keys/release.asc', |
| 479 |
:mirrorlist => 'absent', |
| 480 |
:priority => '10' |
| 481 |
)} |
| 482 |
|
| 483 |
it { should contain_yumrepo('ext-ceph-noarch').with( |
| 484 |
:enabled => '1', |
| 485 |
:descr => 'External Ceph noarch', |
| 486 |
:name => 'ext-ceph-firefly-noarch', |
| 487 |
:baseurl => 'http://download.ceph.com/rpm-firefly/el7/noarch', |
| 488 |
:gpgcheck => '1', |
| 489 |
:gpgkey => 'https://download.ceph.com/keys/release.asc', |
| 490 |
:mirrorlist => 'absent', |
| 491 |
:priority => '10' |
| 492 |
)} |
| 493 |
end |
| 494 |
|
| 495 |
context 'when using CentOS SIG repository' do |
| 496 |
let :params do |
| 497 |
{ |
| 498 |
:enable_sig => true, |
| 499 |
} |
| 500 |
end |
| 501 |
|
| 502 |
it { should_not contain_yumrepo('ext-epel-7') } |
| 503 |
it { should_not contain_yumrepo('ext-ceph') } |
| 504 |
it { should_not contain_yumrepo('ext-ceph-noarch') } |
| 505 |
it { should contain_yumrepo('ceph-luminous-sig').with_ensure('absent') } |
| 506 |
|
| 507 |
it { should contain_yumrepo('ceph-storage-sig').with( |
| 508 |
:baseurl => 'http://mirror.centos.org/centos/7/storage/x86_64/ceph-nautilus/', |
| 509 |
)} |
| 510 |
end |
| 511 |
|
| 512 |
context 'when using CentOS SIG repository from a mirror' do |
| 513 |
let :params do |
| 514 |
{ |
| 515 |
:enable_sig => true, |
| 516 |
:ceph_mirror => 'https://mymirror/luminous/', |
| 517 |
} |
| 518 |
end |
| 519 |
|
| 520 |
it { should_not contain_yumrepo('ext-epel-7') } |
| 521 |
it { should_not contain_yumrepo('ext-ceph') } |
| 522 |
it { should_not contain_yumrepo('ext-ceph-noarch') } |
| 523 |
it { should contain_yumrepo('ceph-luminous-sig').with_ensure('absent') } |
| 524 |
|
| 525 |
it { should contain_yumrepo('ceph-storage-sig').with( |
| 526 |
:baseurl => 'https://mymirror/luminous/', |
| 527 |
)} |
| 528 |
end |
| 529 |
|
| 530 |
context 'with ensure => absent to disable' do |
| 531 |
let :params do |
| 532 |
{ |
| 533 |
:ensure => 'absent', |
| 534 |
:fastcgi => true |
| 535 |
} |
| 536 |
end |
| 537 |
|
| 538 |
it { should contain_yumrepo('ext-epel-7').with( |
| 539 |
:enabled => '0', |
| 540 |
:descr => 'External EPEL 7', |
| 541 |
:name => 'ext-epel-7', |
| 542 |
:baseurl => 'absent', |
| 543 |
:gpgcheck => '1', |
| 544 |
:gpgkey => 'https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7', |
| 545 |
:mirrorlist => 'http://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch', |
| 546 |
:priority => '20', |
| 547 |
:exclude => 'python-ceph-compat python-rbd python-rados python-cephfs', |
| 548 |
)} |
| 549 |
|
| 550 |
it { should contain_yumrepo('ext-ceph').with( |
| 551 |
:enabled => '0', |
| 552 |
:descr => 'External Ceph nautilus', |
| 553 |
:name => 'ext-ceph-nautilus', |
| 554 |
:baseurl => 'http://download.ceph.com/rpm-nautilus/el7/$basearch', |
| 555 |
:gpgcheck => '1', |
| 556 |
:gpgkey => 'https://download.ceph.com/keys/release.asc', |
| 557 |
:mirrorlist => 'absent', |
| 558 |
:priority => '10' |
| 559 |
)} |
| 560 |
|
| 561 |
it { should contain_yumrepo('ext-ceph-noarch').with( |
| 562 |
:enabled => '0', |
| 563 |
:descr => 'External Ceph noarch', |
| 564 |
:name => 'ext-ceph-nautilus-noarch', |
| 565 |
:baseurl => 'http://download.ceph.com/rpm-nautilus/el7/noarch', |
| 566 |
:gpgcheck => '1', |
| 567 |
:gpgkey => 'https://download.ceph.com/keys/release.asc', |
| 568 |
:mirrorlist => 'absent', |
| 569 |
:priority => '10' |
| 570 |
)} |
| 571 |
|
| 572 |
it { should contain_yumrepo('ext-ceph-fastcgi').with( |
| 573 |
:enabled => '0', |
| 574 |
:descr => 'FastCGI basearch packages for Ceph', |
| 575 |
:name => 'ext-ceph-fastcgi', |
| 576 |
:baseurl => 'http://gitbuilder.ceph.com/mod_fastcgi-rpm-rhel7-x86_64-basic/ref/master', |
| 577 |
:gpgcheck => '1', |
| 578 |
:gpgkey => 'https://download.ceph.com/keys/autobuild.asc', |
| 579 |
:mirrorlist => 'absent', |
| 580 |
:priority => '20' |
| 581 |
)} |
| 582 |
end |
| 583 |
|
| 584 |
context 'with ceph fast-cgi' do |
| 585 |
let :params do |
| 586 |
{ |
| 587 |
:fastcgi => true |
| 588 |
} |
| 589 |
end |
| 590 |
|
| 591 |
it { should contain_yumrepo('ext-epel-7').with( |
| 592 |
:enabled => '1', |
| 593 |
:descr => 'External EPEL 7', |
| 594 |
:name => 'ext-epel-7', |
| 595 |
:baseurl => 'absent', |
| 596 |
:gpgcheck => '1', |
| 597 |
:gpgkey => 'https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7', |
| 598 |
:mirrorlist => 'http://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch', |
| 599 |
:priority => '20', |
| 600 |
:exclude => 'python-ceph-compat python-rbd python-rados python-cephfs', |
| 601 |
)} |
| 602 |
|
| 603 |
it { should contain_yumrepo('ext-ceph').with( |
| 604 |
:enabled => '1', |
| 605 |
:descr => 'External Ceph nautilus', |
| 606 |
:name => 'ext-ceph-nautilus', |
| 607 |
:baseurl => 'http://download.ceph.com/rpm-nautilus/el7/$basearch', |
| 608 |
:gpgcheck => '1', |
| 609 |
:gpgkey => 'https://download.ceph.com/keys/release.asc', |
| 610 |
:mirrorlist => 'absent', |
| 611 |
:priority => '10' |
| 612 |
)} |
| 613 |
|
| 614 |
it { should contain_yumrepo('ext-ceph-noarch').with( |
| 615 |
:enabled => '1', |
| 616 |
:descr => 'External Ceph noarch', |
| 617 |
:name => 'ext-ceph-nautilus-noarch', |
| 618 |
:baseurl => 'http://download.ceph.com/rpm-nautilus/el7/noarch', |
| 619 |
:gpgcheck => '1', |
| 620 |
:gpgkey => 'https://download.ceph.com/keys/release.asc', |
| 621 |
:mirrorlist => 'absent', |
| 622 |
:priority => '10' |
| 623 |
)} |
| 624 |
|
| 625 |
it { should contain_yumrepo('ext-ceph-fastcgi').with( |
| 626 |
:enabled => '1', |
| 627 |
:descr => 'FastCGI basearch packages for Ceph', |
| 628 |
:name => 'ext-ceph-fastcgi', |
| 629 |
:baseurl => 'http://gitbuilder.ceph.com/mod_fastcgi-rpm-rhel7-x86_64-basic/ref/master', |
| 630 |
:gpgcheck => '1', |
| 631 |
:gpgkey => 'https://download.ceph.com/keys/autobuild.asc', |
| 632 |
:mirrorlist => 'absent', |
| 633 |
:priority => '20' |
| 634 |
)} |
| 635 |
end |
| 636 |
end |
| 637 |
|
| 638 |
on_supported_os({ |
| 639 |
:supported_os => OSDefaults.get_supported_os |
| 640 |
}).each do |os,facts| |
| 641 |
context "on #{os}" do |
| 642 |
let (:facts) do |
| 643 |
facts.merge!(OSDefaults.get_facts()) |
| 644 |
end |
| 645 |
|
| 646 |
it_behaves_like "ceph::repo on #{facts[:operatingsystem]}" |
| 647 |
|
| 648 |
if facts[:operatingsystem] == 'CentOS' |
| 649 |
it_behaves_like 'ceph::repo on RHEL' |
| 650 |
end |
| 651 |
end |
| 652 |
end |
| 653 |
end |