Replace legacy facts and use fact hash

... because the latest lint no longer allows usage of legacy facts and
top scope fact.

This also disables puppet 5 unit test job because the job is broken
with structured facts.

Change-Id: Id11ccaf89a44d093de29ba3c15165153eea4be56
This commit is contained in:
Takashi Kajinami 2023-03-02 14:57:04 +09:00
parent b6731d247e
commit 8b88ce61a5
27 changed files with 199 additions and 214 deletions

View File

@ -15,6 +15,7 @@
name: puppet-ceph-unit-5.5-centos-8-stream
parent: puppet-openstack-unit-base
nodeset: centos-8-stream
voting: false
# stable/ussuri is the last release with Puppet 5.x support
override-checkout: stable/ussuri
vars:

View File

@ -60,13 +60,13 @@ Enjoy your ceph cluster!
mon_initial_members => 'mon1,mon2,mon3',
mon_host => '<ip of mon1>,<ip of mon2>,<ip of mon3>',
}
ceph::mon { $::hostname:
ceph::mon { $facts['networking']['hostname']:
key => $mon_key,
}
Ceph::Key {
inject => true,
inject_as_id => 'mon.',
inject_keyring => "/var/lib/ceph/mon/ceph-${::hostname}/keyring",
inject_keyring => "/var/lib/ceph/mon/ceph-${facts['networking']['hostname']}/keyring",
}
ceph::key { 'client.admin':
secret => $admin_key,

View File

@ -42,7 +42,7 @@
# Optional. Default is running.
#
# [*mds_id*] The ID of the MDS instance.
# Optional. Default is $::hostname
# Optional. Default is $facts['networking']['hostname']
#
# [*keyring*] The location of the keyring used by MDSs
# Optional. Same default as ceph.
@ -58,7 +58,7 @@ class ceph::mds (
$mds_data = undef,
$mds_enable = true,
$mds_ensure = 'running',
$mds_id = $::hostname,
$mds_id = $facts['networking']['hostname'],
$keyring = undef,
$cluster = 'ceph',
) inherits ceph::params {

View File

@ -186,7 +186,7 @@ ceph-volume lvm list ${data}
timeout => $exec_timeout,
tag => 'prepare',
}
if (str2bool($::selinux) == true) {
if (str2bool($facts['os']['selinux']['enabled']) == true) {
ensure_packages($ceph::params::pkg_policycoreutils, {'ensure' => 'present'})
exec { "fcontext_${name}":
command => "/bin/true # comment to satisfy puppet syntax requirements

View File

@ -49,7 +49,7 @@ class ceph::params (
) {
$pkg_mds = 'ceph-mds'
case $::osfamily {
case $facts['os']['family'] {
'Debian': {
$pkg_radosgw = 'radosgw'
$user_radosgw = 'www-data'
@ -61,7 +61,7 @@ class ceph::params (
$pkg_radosgw = 'ceph-radosgw'
$user_radosgw = 'apache'
$pkg_fastcgi = 'mod_fastcgi'
if (Integer.new($::os['release']['major']) > 7) {
if (Integer.new($facts['os']['release']['major']) > 7) {
$pkg_policycoreutils = 'policycoreutils-python-utils'
} else {
$pkg_policycoreutils = 'policycoreutils-python'
@ -69,8 +69,7 @@ class ceph::params (
}
default: {
fail("Unsupported osfamily: ${::osfamily} operatingsystem: ${::operatingsystem}, \
module ${module_name} only supports osfamily Debian or RedHat")
fail("Unsupported osfamily: ${facts['os']['family']}")
}
}
}

View File

@ -27,12 +27,12 @@ class ceph::profile::mds {
}
if !empty($ceph::profile::params::mds_key) {
ceph::key { "mds.${::hostname}":
ceph::key { "mds.${facts['networking']['hostname']}":
cap_mon => 'allow profile mds',
cap_osd => 'allow rwx',
cap_mds => 'allow',
inject => true,
keyring_path => "/var/lib/ceph/mds/ceph-${::hostname}/keyring",
keyring_path => "/var/lib/ceph/mds/ceph-${facts['networking']['hostname']}/keyring",
secret => $ceph::profile::params::mds_key,
user => 'ceph',
group => 'ceph'

View File

@ -22,7 +22,7 @@
class ceph::profile::mgr {
require ceph::profile::base
ceph::mgr { $::hostname:
ceph::mgr { $facts['networking']['hostname']:
authentication_type => $ceph::profile::params::authentication_type,
key => $ceph::profile::params::mgr_key,
inject_key => true,

View File

@ -23,7 +23,7 @@
class ceph::profile::mon {
require ceph::profile::base
ceph::mon { $::hostname:
ceph::mon { $facts['networking']['hostname']:
authentication_type => $ceph::profile::params::authentication_type,
key => $ceph::profile::params::mon_key,
keyring => $ceph::profile::params::mon_keyring,
@ -33,7 +33,7 @@ class ceph::profile::mon {
$defaults = {
inject => true,
inject_as_id => 'mon.',
inject_keyring => "/var/lib/ceph/mon/ceph-${::hostname}/keyring",
inject_keyring => "/var/lib/ceph/mon/ceph-${facts['networking']['hostname']}/keyring",
}
if !empty($ceph::profile::params::client_keys) {

View File

@ -74,7 +74,7 @@ class ceph::repo (
$stream = false,
$ceph_mirror = undef,
) inherits ceph::params {
case $::osfamily {
case $facts['os']['family'] {
'Debian': {
include apt
@ -93,7 +93,7 @@ class ceph::repo (
apt::source { 'ceph':
ensure => $ensure,
location => $ceph_mirror_real,
release => $::lsbdistcodename,
release => $facts['os']['distro']['codename'],
tag => 'ceph',
}
@ -107,8 +107,8 @@ class ceph::repo (
apt::source { 'ceph-fastcgi':
ensure => $ensure,
location => "http://gitbuilder.ceph.com/libapache-mod-fastcgi-deb-${::lsbdistcodename}-${::hardwaremodel}-basic/ref/master",
release => $::lsbdistcodename,
location => "http://gitbuilder.ceph.com/libapache-mod-fastcgi-deb-${facts['os']['distro']['codename']}-${facts['os']['hardware']}-basic/ref/master",
release => $facts['os']['distro']['codename'],
require => Apt::Key['ceph-gitbuilder'],
}
@ -124,23 +124,23 @@ class ceph::repo (
# If you want to deploy Ceph using packages provided by CentOS SIG
# https://wiki.centos.org/SpecialInterestGroup/Storage/
if $enable_sig {
if $::operatingsystem != 'CentOS' {
if $facts['os']['name'] != 'CentOS' {
warning("CentOS SIG repository is only supported on CentOS operating system, \
not on ${::operatingsystem}, which can lead to packaging issues.")
not on ${facts['os']['name']}, which can lead to packaging issues.")
}
if $ceph_mirror {
$ceph_mirror_real = $ceph_mirror
} else {
# NOTE(tobias-urdin): mirror.centos.org doesnt have https support
if $stream {
if versioncmp($::operatingsystemmajrelease, '9') >= 0 {
if versioncmp($facts['os']['release']['major'], '9') >= 0 {
$centos_mirror = 'mirror.stream.centos.org/SIGs'
} else {
$centos_mirror = 'mirror.centos.org/centos'
}
$ceph_mirror_real = "http://${centos_mirror}/${::operatingsystemmajrelease}-stream/storage/x86_64/ceph-${release}/"
$ceph_mirror_real = "http://${centos_mirror}/${facts['os']['release']['major']}-stream/storage/x86_64/ceph-${release}/"
} else {
$ceph_mirror_real = "http://mirror.centos.org/centos/${::operatingsystemmajrelease}/storage/x86_64/ceph-${release}/"
$ceph_mirror_real = "http://mirror.centos.org/centos/${facts['os']['release']['major']}/storage/x86_64/ceph-${release}/"
}
}
yumrepo { 'ceph-luminous-sig':
@ -157,7 +157,7 @@ not on ${::operatingsystem}, which can lead to packaging issues.")
Yumrepo['ceph-luminous-sig'] -> Yumrepo['ceph-storage-sig'] -> Package<| tag == 'ceph' |>
} else {
# If you want to deploy Ceph using packages provided by ceph.com repositories.
$el = $::operatingsystemmajrelease
$el = $facts['os']['release']['major']
Yumrepo {
proxy => $proxy,
@ -232,8 +232,7 @@ not on ${::operatingsystem}, which can lead to packaging issues.")
}
default: {
fail("Unsupported osfamily: ${::osfamily} operatingsystem: ${::operatingsystem}, \
module ${module_name} only supports osfamily Debian and RedHat")
fail("Unsupported osfamily: ${facts['os']['family']}")
}
}
}

View File

@ -50,7 +50,7 @@
# Optional. Default is '/var/log/ceph/radosgw.log'.
#
# [*rgw_dns_name*] Hostname to use for the service.
# Optional. Default is $fqdn.
# Optional. Default is $facts['networking']['fqdn'].
#
# [*rgw_socket_path*] Path to socket file.
# Optional. Default is '/tmp/radosgw.sock'.
@ -69,7 +69,7 @@
# Optional. Default is undef.
#
# [*rgw_swift_url*] The URL for the Ceph Object Gateway Swift API.
# Optional. Default is http://$fqdn:7480.
# Optional. Default is "http://${facts['networking']['fqdn']}:7480".
#
# [*rgw_swift_url_prefix*] The URL prefix for the Swift API.
# Optional. Default is 'swift'.
@ -101,13 +101,13 @@ define ceph::rgw (
$user = $ceph::params::user_radosgw,
$keyring_path = "/etc/ceph/ceph.client.${name}.keyring",
$log_file = '/var/log/ceph/radosgw.log',
$rgw_dns_name = $::fqdn,
$rgw_dns_name = $facts['networking']['fqdn'],
$rgw_socket_path = $ceph::params::rgw_socket_path,
$rgw_print_continue = false,
$rgw_port = undef,
$frontend_type = 'civetweb',
$rgw_frontends = undef,
$rgw_swift_url = "http://${::fqdn}:7480",
$rgw_swift_url = "http://${facts['networking']['fqdn']}:7480",
$rgw_swift_url_prefix = 'swift',
$rgw_swift_account_in_url = false,
$rgw_swift_versioning_enabled = false,
@ -133,7 +133,7 @@ define ceph::rgw (
}
ceph_config {
"client.${name}/host": value => $::hostname;
"client.${name}/host": value => $facts['networking']['hostname'];
"client.${name}/keyring": value => $keyring_path;
"client.${name}/log_file": value => $log_file;
"client.${name}/user": value => $user;

View File

@ -34,7 +34,7 @@
# Optional. Default is 80.
#
# [*rgw_dns_name*] Hostname to use for the service.
# Optional. Default is $fqdn.
# Optional. Default is $facts['networking']['fqdn'].
#
# [*rewrite_rule*] RewriteRule for the apache config.
# Optional. Default is '.* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]'.
@ -67,7 +67,7 @@
define ceph::rgw::apache_proxy_fcgi (
$admin_email = 'root@localhost',
$docroot = '/var/www',
$rgw_dns_name = $::fqdn,
$rgw_dns_name = $facts['networking']['fqdn'],
$rgw_port = 80,
$rewrite_rule = '.* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]',
$setenv = 'proxy-nokeepalive 1',

View File

@ -21,8 +21,8 @@ describe 'ceph::mds' do
shared_examples 'ceph mds' do
describe "activated with default params" do
it { should contain_ceph_config('mds/mds_data').with_value('/var/lib/ceph/mds/ceph-myhostname') }
it { should contain_ceph_config('mds/keyring').with_value('/var/lib/ceph/mds/ceph-myhostname/keyring') }
it { should contain_ceph_config('mds/mds_data').with_value('/var/lib/ceph/mds/ceph-foo') }
it { should contain_ceph_config('mds/keyring').with_value('/var/lib/ceph/mds/ceph-foo/keyring') }
it { should contain_package('ceph-mds').with('ensure' => 'present') }
end
@ -68,7 +68,7 @@ describe 'ceph::mds' do
on_supported_os.each do |os,facts|
context "on #{os}" do
let (:facts) do
facts.merge!(OSDefaults.get_facts({:hostname => 'myhostname'}))
facts.merge!(OSDefaults.get_facts())
end
it_behaves_like 'ceph mds'

View File

@ -39,8 +39,8 @@ describe 'ceph::profile::base' do
on_supported_os.each do |os, facts|
context "on #{os}" do
let(:facts) do
facts.merge({})
let (:facts) do
facts.merge!(OSDefaults.get_facts())
end
it_behaves_like 'ceph profile base'

View File

@ -58,7 +58,7 @@ describe 'ceph::profile::client' do
context 'with the specific client keys defined in client.yaml' do
before :each do
facts.merge!( :hostname => 'client')
facts[:networking]['hostname'] = 'client'
end
it { should contain_class('ceph::profile::base') }
@ -91,8 +91,8 @@ describe 'ceph::profile::client' do
on_supported_os.each do |os, facts|
context "on #{os}" do
let(:facts) do
facts.merge({})
let (:facts) do
facts.merge!(OSDefaults.get_facts())
end
it_behaves_like 'ceph profile client'

View File

@ -28,7 +28,7 @@ describe 'ceph::profile::fs' do
on_supported_os.each do |os, facts|
context "on #{os}" do
let (:facts) do
facts.merge!(OSDefaults.get_facts({:hostname => 'myhostname'}))
facts.merge!(OSDefaults.get_facts())
end
it_behaves_like 'ceph profile fs'

View File

@ -24,12 +24,12 @@ describe 'ceph::profile::mds' do
it { should contain_class('ceph::mds').with(
'public_addr' => '10.11.12.2',
)}
it { should contain_ceph__key('mds.myhostname').with(
it { should contain_ceph__key('mds.foo').with(
:cap_mon => 'allow profile mds',
:cap_osd => 'allow rwx',
:cap_mds => 'allow',
:inject => true,
:keyring_path => "/var/lib/ceph/mds/ceph-myhostname/keyring",
:keyring_path => "/var/lib/ceph/mds/ceph-foo/keyring",
:secret => 'AQDLOh1VgEp6FRAAFzT7Zw+Y9V6JJExQAsRnRQ==',
:user => 'ceph',
:group => 'ceph'
@ -39,7 +39,7 @@ describe 'ceph::profile::mds' do
on_supported_os.each do |os, facts|
context "on #{os}" do
let (:facts) do
facts.merge!(OSDefaults.get_facts({:hostname => 'myhostname'}))
facts.merge!(OSDefaults.get_facts())
end
it_behaves_like 'ceph profile mds'

View File

@ -20,7 +20,7 @@ require 'spec_helper'
describe 'ceph::profile::mgr' do
shared_examples 'ceph profile mgr' do
it { should contain_ceph__mgr('first').with(
it { should contain_ceph__mgr('foo').with(
:authentication_type => 'cephx',
:key => 'AQASGFDFUHBHDG9SDdsyffV1xgsn1pgr3GcKPg==',
:inject_key => true)
@ -29,8 +29,8 @@ describe 'ceph::profile::mgr' do
on_supported_os.each do |os, facts|
context "on #{os}" do
let(:facts) do
facts.merge({:hostname => 'first'})
let (:facts) do
facts.merge!(OSDefaults.get_facts())
end
it_behaves_like 'ceph profile mgr'

View File

@ -21,7 +21,7 @@ describe 'ceph::profile::mon' do
shared_examples 'ceph profile mon' do
it { should contain_ceph__mon('first').with(
it { should contain_ceph__mon('foo').with(
:authentication_type => 'cephx',
:key => 'AQATGHJTUCBqIBAA7M2yafV1xctn1pgr3GcKPg==',
:public_addr => '10.11.12.2')
@ -57,15 +57,15 @@ describe 'ceph::profile::mon' do
'defaults' => {
'inject' => true,
'inject_as_id' => 'mon.',
'inject_keyring' => '/var/lib/ceph/mon/ceph-first/keyring'
'inject_keyring' => '/var/lib/ceph/mon/ceph-foo/keyring'
}
)}
end
on_supported_os.each do |os, facts|
context "on #{os}" do
let(:facts) do
facts.merge({:hostname => 'first'})
let (:facts) do
facts.merge!(OSDefaults.get_facts())
end
it_behaves_like 'ceph profile mon'

View File

@ -23,7 +23,7 @@ describe 'ceph::profile::osd' do
context 'with the default osd defined in common.yaml' do
before :each do
facts.merge!( :hostname => 'osd')
facts[:networking]['hostname'] = 'osd'
end
it { should contain_class('ceph::profile::client') }
@ -34,7 +34,7 @@ describe 'ceph::profile::osd' do
context 'with the host specific first.yaml' do
before :each do
facts.merge!( :hostname => 'first')
facts[:networking]['hostname'] = 'first'
end
it { should contain_class('ceph::profile::client') }
@ -44,8 +44,8 @@ describe 'ceph::profile::osd' do
on_supported_os.each do |os, facts|
context "on #{os}" do
let(:facts) do
facts.merge({})
let (:facts) do
facts.merge!(OSDefaults.get_facts())
end
it_behaves_like 'ceph profile osd'

View File

@ -48,8 +48,8 @@ describe 'ceph::profile::params' do
on_supported_os.each do |os, facts|
context "on #{os}" do
let(:facts) do
facts.merge({})
let (:facts) do
facts.merge!(OSDefaults.get_facts())
end
it_behaves_like 'ceph profile params'

View File

@ -30,7 +30,7 @@ describe 'ceph::repo' do
it { should contain_apt__source('ceph').with(
:location => 'http://download.ceph.com/debian-nautilus/',
:release => facts[:lsbdistcodename],
:release => facts[:os]['distro']['codename'],
)}
end
@ -43,7 +43,7 @@ describe 'ceph::repo' do
it { should contain_apt__source('ceph').with(
:location => 'http://myserver.com/debian-nautilus/',
:release => facts[:lsbdistcodename],
:release => facts[:os]['distro']['codename'],
)}
end
@ -61,13 +61,13 @@ describe 'ceph::repo' do
it { should contain_apt__source('ceph').with(
:location => 'http://download.ceph.com/debian-nautilus/',
:release => facts[:lsbdistcodename],
:release => facts[:os]['distro']['codename'],
)}
it { should contain_apt__source('ceph-fastcgi').with(
:ensure => 'present',
:location => "http://gitbuilder.ceph.com/libapache-mod-fastcgi-deb-#{facts[:lsbdistcodename]}-x86_64-basic/ref/master",
:release => facts[:lsbdistcodename],
:location => "http://gitbuilder.ceph.com/libapache-mod-fastcgi-deb-#{facts[:os]['distro']['codename']}-x86_64-basic/ref/master",
:release => facts[:os]['distro']['codename'],
:require => 'Apt::Key[ceph-gitbuilder]'
)}
end
@ -83,13 +83,13 @@ describe 'ceph::repo' do
it { should contain_apt__source('ceph').with(
:ensure => 'absent',
:location => 'http://download.ceph.com/debian-nautilus/',
:release => facts[:lsbdistcodename],
:release => facts[:os]['distro']['codename'],
)}
it { should contain_apt__source('ceph-fastcgi').with(
:ensure => 'absent',
:location => "http://gitbuilder.ceph.com/libapache-mod-fastcgi-deb-#{facts[:lsbdistcodename]}-x86_64-basic/ref/master",
:release => facts[:lsbdistcodename],
:location => "http://gitbuilder.ceph.com/libapache-mod-fastcgi-deb-#{facts[:os]['distro']['codename']}-x86_64-basic/ref/master",
:release => facts[:os]['distro']['codename'],
:require => 'Apt::Key[ceph-gitbuilder]'
)}
end
@ -97,14 +97,14 @@ describe 'ceph::repo' do
shared_examples 'ceph::repo on RedHat' do
context 'with default params' do
it { should contain_yumrepo("ext-epel-#{facts[:operatingsystemmajrelease]}").with(
it { should contain_yumrepo("ext-epel-#{facts[:os]['release']['major']}").with(
:enabled => '1',
:descr => "External EPEL #{facts[:operatingsystemmajrelease]}",
:name => "ext-epel-#{facts[:operatingsystemmajrelease]}",
:descr => "External EPEL #{facts[:os]['release']['major']}",
:name => "ext-epel-#{facts[:os]['release']['major']}",
:baseurl => 'absent',
:gpgcheck => '1',
:gpgkey => "https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-#{facts[:operatingsystemmajrelease]}",
:mirrorlist => "http://mirrors.fedoraproject.org/metalink?repo=epel-#{facts[:operatingsystemmajrelease]}&arch=$basearch",
:gpgkey => "https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-#{facts[:os]['release']['major']}",
:mirrorlist => "http://mirrors.fedoraproject.org/metalink?repo=epel-#{facts[:os]['release']['major']}&arch=$basearch",
:priority => '20',
:exclude => 'python-ceph-compat python-rbd python-rados python-cephfs',
)}
@ -113,7 +113,7 @@ describe 'ceph::repo' do
:enabled => '1',
:descr => 'External Ceph nautilus',
:name => 'ext-ceph-nautilus',
:baseurl => "http://download.ceph.com/rpm-nautilus/el#{facts[:operatingsystemmajrelease]}/$basearch",
:baseurl => "http://download.ceph.com/rpm-nautilus/el#{facts[:os]['release']['major']}/$basearch",
:gpgcheck => '1',
:gpgkey => 'https://download.ceph.com/keys/release.asc',
:mirrorlist => 'absent',
@ -124,7 +124,7 @@ describe 'ceph::repo' do
:enabled => '1',
:descr => 'External Ceph noarch',
:name => 'ext-ceph-nautilus-noarch',
:baseurl => "http://download.ceph.com/rpm-nautilus/el#{facts[:operatingsystemmajrelease]}/noarch",
:baseurl => "http://download.ceph.com/rpm-nautilus/el#{facts[:os]['release']['major']}/noarch",
:gpgcheck => '1',
:gpgkey => 'https://download.ceph.com/keys/release.asc',
:mirrorlist => 'absent',
@ -139,14 +139,14 @@ describe 'ceph::repo' do
}
end
it { should contain_yumrepo("ext-epel-#{facts[:operatingsystemmajrelease]}").with(
it { should contain_yumrepo("ext-epel-#{facts[:os]['release']['major']}").with(
:enabled => '1',
:descr => "External EPEL #{facts[:operatingsystemmajrelease]}",
:name => "ext-epel-#{facts[:operatingsystemmajrelease]}",
:descr => "External EPEL #{facts[:os]['release']['major']}",
:name => "ext-epel-#{facts[:os]['release']['major']}",
:baseurl => 'absent',
:gpgcheck => '1',
:gpgkey => "https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-#{facts[:operatingsystemmajrelease]}",
:mirrorlist => "http://mirrors.fedoraproject.org/metalink?repo=epel-#{facts[:operatingsystemmajrelease]}&arch=$basearch",
:gpgkey => "https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-#{facts[:os]['release']['major']}",
:mirrorlist => "http://mirrors.fedoraproject.org/metalink?repo=epel-#{facts[:os]['release']['major']}&arch=$basearch",
:priority => '20',
:exclude => 'python-ceph-compat python-rbd python-rados python-cephfs',
)}
@ -155,7 +155,7 @@ describe 'ceph::repo' do
:enabled => '1',
:descr => 'External Ceph firefly',
:name => 'ext-ceph-firefly',
:baseurl => "http://download.ceph.com/rpm-firefly/el#{facts[:operatingsystemmajrelease]}/$basearch",
:baseurl => "http://download.ceph.com/rpm-firefly/el#{facts[:os]['release']['major']}/$basearch",
:gpgcheck => '1',
:gpgkey => 'https://download.ceph.com/keys/release.asc',
:mirrorlist => 'absent',
@ -166,7 +166,7 @@ describe 'ceph::repo' do
:enabled => '1',
:descr => 'External Ceph noarch',
:name => 'ext-ceph-firefly-noarch',
:baseurl => "http://download.ceph.com/rpm-firefly/el#{facts[:operatingsystemmajrelease]}/noarch",
:baseurl => "http://download.ceph.com/rpm-firefly/el#{facts[:os]['release']['major']}/noarch",
:gpgcheck => '1',
:gpgkey => 'https://download.ceph.com/keys/release.asc',
:mirrorlist => 'absent',
@ -181,7 +181,7 @@ describe 'ceph::repo' do
}
end
it { should_not contain_yumrepo("ext-epel-#{facts[:operatingsystemmajrelease]}") }
it { should_not contain_yumrepo("ext-epel-#{facts[:os]['release']['major']}") }
end
context 'when using a proxy for yum repositories' do
@ -193,14 +193,14 @@ describe 'ceph::repo' do
}
end
it { should contain_yumrepo("ext-epel-#{facts[:operatingsystemmajrelease]}").with(
it { should contain_yumrepo("ext-epel-#{facts[:os]['release']['major']}").with(
:enabled => '1',
:descr => "External EPEL #{facts[:operatingsystemmajrelease]}",
:name => "ext-epel-#{facts[:operatingsystemmajrelease]}",
:descr => "External EPEL #{facts[:os]['release']['major']}",
:name => "ext-epel-#{facts[:os]['release']['major']}",
:baseurl => 'absent',
:gpgcheck => '1',
:gpgkey => "https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-#{facts[:operatingsystemmajrelease]}",
:mirrorlist => "http://mirrors.fedoraproject.org/metalink?repo=epel-#{facts[:operatingsystemmajrelease]}&arch=$basearch",
:gpgkey => "https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-#{facts[:os]['release']['major']}",
:mirrorlist => "http://mirrors.fedoraproject.org/metalink?repo=epel-#{facts[:os]['release']['major']}&arch=$basearch",
:priority => '20',
:exclude => 'python-ceph-compat python-rbd python-rados python-cephfs',
:proxy => 'http://someproxy.com:8080/',
@ -212,7 +212,7 @@ describe 'ceph::repo' do
:enabled => '1',
:descr => 'External Ceph nautilus',
:name => 'ext-ceph-nautilus',
:baseurl => "http://download.ceph.com/rpm-nautilus/el#{facts[:operatingsystemmajrelease]}/$basearch",
:baseurl => "http://download.ceph.com/rpm-nautilus/el#{facts[:os]['release']['major']}/$basearch",
:gpgcheck => '1',
:gpgkey => 'https://download.ceph.com/keys/release.asc',
:mirrorlist => 'absent',
@ -226,7 +226,7 @@ describe 'ceph::repo' do
:enabled => '1',
:descr => 'External Ceph noarch',
:name => 'ext-ceph-nautilus-noarch',
:baseurl => "http://download.ceph.com/rpm-nautilus/el#{facts[:operatingsystemmajrelease]}/noarch",
:baseurl => "http://download.ceph.com/rpm-nautilus/el#{facts[:os]['release']['major']}/noarch",
:gpgcheck => '1',
:gpgkey => 'https://download.ceph.com/keys/release.asc',
:mirrorlist => 'absent',
@ -245,14 +245,14 @@ describe 'ceph::repo' do
}
end
it { should contain_yumrepo("ext-epel-#{facts[:operatingsystemmajrelease]}").with(
it { should contain_yumrepo("ext-epel-#{facts[:os]['release']['major']}").with(
:enabled => '0',
:descr => "External EPEL #{facts[:operatingsystemmajrelease]}",
:name => "ext-epel-#{facts[:operatingsystemmajrelease]}",
:descr => "External EPEL #{facts[:os]['release']['major']}",
:name => "ext-epel-#{facts[:os]['release']['major']}",
:baseurl => 'absent',
:gpgcheck => '1',
:gpgkey => "https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-#{facts[:operatingsystemmajrelease]}",
:mirrorlist => "http://mirrors.fedoraproject.org/metalink?repo=epel-#{facts[:operatingsystemmajrelease]}&arch=$basearch",
:gpgkey => "https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-#{facts[:os]['release']['major']}",
:mirrorlist => "http://mirrors.fedoraproject.org/metalink?repo=epel-#{facts[:os]['release']['major']}&arch=$basearch",
:priority => '20',
:exclude => 'python-ceph-compat python-rbd python-rados python-cephfs',
)}
@ -261,7 +261,7 @@ describe 'ceph::repo' do
:enabled => '0',
:descr => 'External Ceph nautilus',
:name => 'ext-ceph-nautilus',
:baseurl => "http://download.ceph.com/rpm-nautilus/el#{facts[:operatingsystemmajrelease]}/$basearch",
:baseurl => "http://download.ceph.com/rpm-nautilus/el#{facts[:os]['release']['major']}/$basearch",
:gpgcheck => '1',
:gpgkey => 'https://download.ceph.com/keys/release.asc',
:mirrorlist => 'absent',
@ -272,7 +272,7 @@ describe 'ceph::repo' do
:enabled => '0',
:descr => 'External Ceph noarch',
:name => 'ext-ceph-nautilus-noarch',
:baseurl => "http://download.ceph.com/rpm-nautilus/el#{facts[:operatingsystemmajrelease]}/noarch",
:baseurl => "http://download.ceph.com/rpm-nautilus/el#{facts[:os]['release']['major']}/noarch",
:gpgcheck => '1',
:gpgkey => 'https://download.ceph.com/keys/release.asc',
:mirrorlist => 'absent',
@ -283,7 +283,7 @@ describe 'ceph::repo' do
:enabled => '0',
:descr => 'FastCGI basearch packages for Ceph',
:name => 'ext-ceph-fastcgi',
:baseurl => "http://gitbuilder.ceph.com/mod_fastcgi-rpm-rhel#{facts[:operatingsystemmajrelease]}-x86_64-basic/ref/master",
:baseurl => "http://gitbuilder.ceph.com/mod_fastcgi-rpm-rhel#{facts[:os]['release']['major']}-x86_64-basic/ref/master",
:gpgcheck => '1',
:gpgkey => 'https://download.ceph.com/keys/autobuild.asc',
:mirrorlist => 'absent',
@ -298,14 +298,14 @@ describe 'ceph::repo' do
}
end
it { should contain_yumrepo("ext-epel-#{facts[:operatingsystemmajrelease]}").with(
it { should contain_yumrepo("ext-epel-#{facts[:os]['release']['major']}").with(
:enabled => '1',
:descr => "External EPEL #{facts[:operatingsystemmajrelease]}",
:name => "ext-epel-#{facts[:operatingsystemmajrelease]}",
:descr => "External EPEL #{facts[:os]['release']['major']}",
:name => "ext-epel-#{facts[:os]['release']['major']}",
:baseurl => 'absent',
:gpgcheck => '1',
:gpgkey => "https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-#{facts[:operatingsystemmajrelease]}",
:mirrorlist => "http://mirrors.fedoraproject.org/metalink?repo=epel-#{facts[:operatingsystemmajrelease]}&arch=$basearch",
:gpgkey => "https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-#{facts[:os]['release']['major']}",
:mirrorlist => "http://mirrors.fedoraproject.org/metalink?repo=epel-#{facts[:os]['release']['major']}&arch=$basearch",
:priority => '20',
:exclude => 'python-ceph-compat python-rbd python-rados python-cephfs',
)}
@ -314,7 +314,7 @@ describe 'ceph::repo' do
:enabled => '1',
:descr => 'External Ceph nautilus',
:name => 'ext-ceph-nautilus',
:baseurl => "http://download.ceph.com/rpm-nautilus/el#{facts[:operatingsystemmajrelease]}/$basearch",
:baseurl => "http://download.ceph.com/rpm-nautilus/el#{facts[:os]['release']['major']}/$basearch",
:gpgcheck => '1',
:gpgkey => 'https://download.ceph.com/keys/release.asc',
:mirrorlist => 'absent',
@ -325,7 +325,7 @@ describe 'ceph::repo' do
:enabled => '1',
:descr => 'External Ceph noarch',
:name => 'ext-ceph-nautilus-noarch',
:baseurl => "http://download.ceph.com/rpm-nautilus/el#{facts[:operatingsystemmajrelease]}/noarch",
:baseurl => "http://download.ceph.com/rpm-nautilus/el#{facts[:os]['release']['major']}/noarch",
:gpgcheck => '1',
:gpgkey => 'https://download.ceph.com/keys/release.asc',
:mirrorlist => 'absent',
@ -336,7 +336,7 @@ describe 'ceph::repo' do
:enabled => '1',
:descr => 'FastCGI basearch packages for Ceph',
:name => 'ext-ceph-fastcgi',
:baseurl => "http://gitbuilder.ceph.com/mod_fastcgi-rpm-rhel#{facts[:operatingsystemmajrelease]}-x86_64-basic/ref/master",
:baseurl => "http://gitbuilder.ceph.com/mod_fastcgi-rpm-rhel#{facts[:os]['release']['major']}-x86_64-basic/ref/master",
:gpgcheck => '1',
:gpgkey => 'https://download.ceph.com/keys/autobuild.asc',
:mirrorlist => 'absent',
@ -347,14 +347,14 @@ describe 'ceph::repo' do
shared_examples 'ceph::repo on CentOS' do
context 'with default params' do
it { should contain_yumrepo("ext-epel-#{facts[:operatingsystemmajrelease]}").with(
it { should contain_yumrepo("ext-epel-#{facts[:os]['release']['major']}").with(
:enabled => '1',
:descr => "External EPEL #{facts[:operatingsystemmajrelease]}",
:name => "ext-epel-#{facts[:operatingsystemmajrelease]}",
:descr => "External EPEL #{facts[:os]['release']['major']}",
:name => "ext-epel-#{facts[:os]['release']['major']}",
:baseurl => 'absent',
:gpgcheck => '1',
:gpgkey => "https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-#{facts[:operatingsystemmajrelease]}",
:mirrorlist => "http://mirrors.fedoraproject.org/metalink?repo=epel-#{facts[:operatingsystemmajrelease]}&arch=$basearch",
:gpgkey => "https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-#{facts[:os]['release']['major']}",
:mirrorlist => "http://mirrors.fedoraproject.org/metalink?repo=epel-#{facts[:os]['release']['major']}&arch=$basearch",
:priority => '20',
:exclude => 'python-ceph-compat python-rbd python-rados python-cephfs',
)}
@ -363,7 +363,7 @@ describe 'ceph::repo' do
:enabled => '1',
:descr => 'External Ceph nautilus',
:name => 'ext-ceph-nautilus',
:baseurl => "http://download.ceph.com/rpm-nautilus/el#{facts[:operatingsystemmajrelease]}/$basearch",
:baseurl => "http://download.ceph.com/rpm-nautilus/el#{facts[:os]['release']['major']}/$basearch",
:gpgcheck => '1',
:gpgkey => 'https://download.ceph.com/keys/release.asc',
:mirrorlist => 'absent',
@ -374,7 +374,7 @@ describe 'ceph::repo' do
:enabled => '1',
:descr => 'External Ceph noarch',
:name => 'ext-ceph-nautilus-noarch',
:baseurl => "http://download.ceph.com/rpm-nautilus/el#{facts[:operatingsystemmajrelease]}/noarch",
:baseurl => "http://download.ceph.com/rpm-nautilus/el#{facts[:os]['release']['major']}/noarch",
:gpgcheck => '1',
:gpgkey => 'https://download.ceph.com/keys/release.asc',
:mirrorlist => 'absent',
@ -389,14 +389,14 @@ describe 'ceph::repo' do
}
end
it { should contain_yumrepo("ext-epel-#{facts[:operatingsystemmajrelease]}").with(
it { should contain_yumrepo("ext-epel-#{facts[:os]['release']['major']}").with(
:enabled => '1',
:descr => "External EPEL #{facts[:operatingsystemmajrelease]}",
:name => "ext-epel-#{facts[:operatingsystemmajrelease]}",
:descr => "External EPEL #{facts[:os]['release']['major']}",
:name => "ext-epel-#{facts[:os]['release']['major']}",
:baseurl => 'absent',
:gpgcheck => '1',
:gpgkey => "https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-#{facts[:operatingsystemmajrelease]}",
:mirrorlist => "http://mirrors.fedoraproject.org/metalink?repo=epel-#{facts[:operatingsystemmajrelease]}&arch=$basearch",
:gpgkey => "https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-#{facts[:os]['release']['major']}",
:mirrorlist => "http://mirrors.fedoraproject.org/metalink?repo=epel-#{facts[:os]['release']['major']}&arch=$basearch",
:priority => '20',
:exclude => 'python-ceph-compat python-rbd python-rados python-cephfs',
)}
@ -405,7 +405,7 @@ describe 'ceph::repo' do
:enabled => '1',
:descr => 'External Ceph firefly',
:name => 'ext-ceph-firefly',
:baseurl => "http://download.ceph.com/rpm-firefly/el#{facts[:operatingsystemmajrelease]}/$basearch",
:baseurl => "http://download.ceph.com/rpm-firefly/el#{facts[:os]['release']['major']}/$basearch",
:gpgcheck => '1',
:gpgkey => 'https://download.ceph.com/keys/release.asc',
:mirrorlist => 'absent',
@ -416,7 +416,7 @@ describe 'ceph::repo' do
:enabled => '1',
:descr => 'External Ceph noarch',
:name => 'ext-ceph-firefly-noarch',
:baseurl => "http://download.ceph.com/rpm-firefly/el#{facts[:operatingsystemmajrelease]}/noarch",
:baseurl => "http://download.ceph.com/rpm-firefly/el#{facts[:os]['release']['major']}/noarch",
:gpgcheck => '1',
:gpgkey => 'https://download.ceph.com/keys/release.asc',
:mirrorlist => 'absent',
@ -431,49 +431,13 @@ describe 'ceph::repo' do
}
end
it { should_not contain_yumrepo("ext-epel-#{facts[:operatingsystemmajrelease]}") }
it { should_not contain_yumrepo("ext-epel-#{facts[:os]['release']['major']}") }
it { should_not contain_yumrepo('ext-ceph') }
it { should_not contain_yumrepo('ext-ceph-noarch') }
it { should contain_yumrepo('ceph-luminous-sig').with_ensure('absent') }
it { should contain_yumrepo('ceph-storage-sig').with(
:baseurl => "http://mirror.centos.org/centos/#{facts[:operatingsystemmajrelease]}/storage/x86_64/ceph-nautilus/",
)}
end
context 'when using CentOS SIG repository and CentOS Stream 8' do
before do
facts.merge!( :operatingsystemmajrelease => "8" )
end
let :params do
{
:enable_sig => true,
:stream => true,
}
end
it { should contain_yumrepo('ceph-luminous-sig').with_ensure('absent') }
it { should contain_yumrepo('ceph-storage-sig').with(
:baseurl => 'http://mirror.centos.org/centos/8-stream/storage/x86_64/ceph-nautilus/',
)}
end
context 'when using CentOS SIG repository and CentOS Stream 9' do
before do
facts.merge!( :operatingsystemmajrelease => "9" )
end
let :params do
{
:enable_sig => true,
:stream => true,
}
end
it { should contain_yumrepo('ceph-storage-sig').with(
:baseurl => 'http://mirror.stream.centos.org/SIGs/9-stream/storage/x86_64/ceph-nautilus/',
:baseurl => "http://mirror.centos.org/centos/#{facts[:os]['release']['major']}/storage/x86_64/ceph-nautilus/",
)}
end
@ -485,7 +449,7 @@ describe 'ceph::repo' do
}
end
it { should_not contain_yumrepo("ext-epel-#{facts[:operatingsystemmajrelease]}") }
it { should_not contain_yumrepo("ext-epel-#{facts[:os]['release']['major']}") }
it { should_not contain_yumrepo('ext-ceph') }
it { should_not contain_yumrepo('ext-ceph-noarch') }
it { should contain_yumrepo('ceph-luminous-sig').with_ensure('absent') }
@ -503,14 +467,14 @@ describe 'ceph::repo' do
}
end
it { should contain_yumrepo("ext-epel-#{facts[:operatingsystemmajrelease]}").with(
it { should contain_yumrepo("ext-epel-#{facts[:os]['release']['major']}").with(
:enabled => '0',
:descr => "External EPEL #{facts[:operatingsystemmajrelease]}",
:name => "ext-epel-#{facts[:operatingsystemmajrelease]}",
:descr => "External EPEL #{facts[:os]['release']['major']}",
:name => "ext-epel-#{facts[:os]['release']['major']}",
:baseurl => 'absent',
:gpgcheck => '1',
:gpgkey => "https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-#{facts[:operatingsystemmajrelease]}",
:mirrorlist => "http://mirrors.fedoraproject.org/metalink?repo=epel-#{facts[:operatingsystemmajrelease]}&arch=$basearch",
:gpgkey => "https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-#{facts[:os]['release']['major']}",
:mirrorlist => "http://mirrors.fedoraproject.org/metalink?repo=epel-#{facts[:os]['release']['major']}&arch=$basearch",
:priority => '20',
:exclude => 'python-ceph-compat python-rbd python-rados python-cephfs',
)}
@ -519,7 +483,7 @@ describe 'ceph::repo' do
:enabled => '0',
:descr => 'External Ceph nautilus',
:name => 'ext-ceph-nautilus',
:baseurl => "http://download.ceph.com/rpm-nautilus/el#{facts[:operatingsystemmajrelease]}/$basearch",
:baseurl => "http://download.ceph.com/rpm-nautilus/el#{facts[:os]['release']['major']}/$basearch",
:gpgcheck => '1',
:gpgkey => 'https://download.ceph.com/keys/release.asc',
:mirrorlist => 'absent',
@ -530,7 +494,7 @@ describe 'ceph::repo' do
:enabled => '0',
:descr => 'External Ceph noarch',
:name => 'ext-ceph-nautilus-noarch',
:baseurl => "http://download.ceph.com/rpm-nautilus/el#{facts[:operatingsystemmajrelease]}/noarch",
:baseurl => "http://download.ceph.com/rpm-nautilus/el#{facts[:os]['release']['major']}/noarch",
:gpgcheck => '1',
:gpgkey => 'https://download.ceph.com/keys/release.asc',
:mirrorlist => 'absent',
@ -541,7 +505,7 @@ describe 'ceph::repo' do
:enabled => '0',
:descr => 'FastCGI basearch packages for Ceph',
:name => 'ext-ceph-fastcgi',
:baseurl => "http://gitbuilder.ceph.com/mod_fastcgi-rpm-rhel#{facts[:operatingsystemmajrelease]}-x86_64-basic/ref/master",
:baseurl => "http://gitbuilder.ceph.com/mod_fastcgi-rpm-rhel#{facts[:os]['release']['major']}-x86_64-basic/ref/master",
:gpgcheck => '1',
:gpgkey => 'https://download.ceph.com/keys/autobuild.asc',
:mirrorlist => 'absent',
@ -556,14 +520,14 @@ describe 'ceph::repo' do
}
end
it { should contain_yumrepo("ext-epel-#{facts[:operatingsystemmajrelease]}").with(
it { should contain_yumrepo("ext-epel-#{facts[:os]['release']['major']}").with(
:enabled => '1',
:descr => "External EPEL #{facts[:operatingsystemmajrelease]}",
:name => "ext-epel-#{facts[:operatingsystemmajrelease]}",
:descr => "External EPEL #{facts[:os]['release']['major']}",
:name => "ext-epel-#{facts[:os]['release']['major']}",
:baseurl => 'absent',
:gpgcheck => '1',
:gpgkey => "https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-#{facts[:operatingsystemmajrelease]}",
:mirrorlist => "http://mirrors.fedoraproject.org/metalink?repo=epel-#{facts[:operatingsystemmajrelease]}&arch=$basearch",
:gpgkey => "https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-#{facts[:os]['release']['major']}",
:mirrorlist => "http://mirrors.fedoraproject.org/metalink?repo=epel-#{facts[:os]['release']['major']}&arch=$basearch",
:priority => '20',
:exclude => 'python-ceph-compat python-rbd python-rados python-cephfs',
)}
@ -572,7 +536,7 @@ describe 'ceph::repo' do
:enabled => '1',
:descr => 'External Ceph nautilus',
:name => 'ext-ceph-nautilus',
:baseurl => "http://download.ceph.com/rpm-nautilus/el#{facts[:operatingsystemmajrelease]}/$basearch",
:baseurl => "http://download.ceph.com/rpm-nautilus/el#{facts[:os]['release']['major']}/$basearch",
:gpgcheck => '1',
:gpgkey => 'https://download.ceph.com/keys/release.asc',
:mirrorlist => 'absent',
@ -583,7 +547,7 @@ describe 'ceph::repo' do
:enabled => '1',
:descr => 'External Ceph noarch',
:name => 'ext-ceph-nautilus-noarch',
:baseurl => "http://download.ceph.com/rpm-nautilus/el#{facts[:operatingsystemmajrelease]}/noarch",
:baseurl => "http://download.ceph.com/rpm-nautilus/el#{facts[:os]['release']['major']}/noarch",
:gpgcheck => '1',
:gpgkey => 'https://download.ceph.com/keys/release.asc',
:mirrorlist => 'absent',
@ -594,7 +558,7 @@ describe 'ceph::repo' do
:enabled => '1',
:descr => 'FastCGI basearch packages for Ceph',
:name => 'ext-ceph-fastcgi',
:baseurl => "http://gitbuilder.ceph.com/mod_fastcgi-rpm-rhel#{facts[:operatingsystemmajrelease]}-x86_64-basic/ref/master",
:baseurl => "http://gitbuilder.ceph.com/mod_fastcgi-rpm-rhel#{facts[:os]['release']['major']}-x86_64-basic/ref/master",
:gpgcheck => '1',
:gpgkey => 'https://download.ceph.com/keys/autobuild.asc',
:mirrorlist => 'absent',
@ -603,18 +567,53 @@ describe 'ceph::repo' do
end
end
on_supported_os({
:supported_os => OSDefaults.get_supported_os
}).each do |os,facts|
shared_examples 'ceph::repo on CentOS Stream 7' do
# No specific test cases
end
shared_examples 'ceph::repo on CentOS Stream 8' do
context 'when using CentOS SIG repository and CentOS Stream 8' do
let :params do
{
:enable_sig => true,
:stream => true,
}
end
it { should contain_yumrepo('ceph-luminous-sig').with_ensure('absent') }
it { should contain_yumrepo('ceph-storage-sig').with(
:baseurl => 'http://mirror.centos.org/centos/8-stream/storage/x86_64/ceph-nautilus/',
)}
end
end
shared_examples 'ceph::repo on CentOS Stream 9' do
context 'when using CentOS SIG repository and CentOS Stream 9' do
let :params do
{
:enable_sig => true,
:stream => true,
}
end
it { should contain_yumrepo('ceph-storage-sig').with(
:baseurl => 'http://mirror.stream.centos.org/SIGs/9-stream/storage/x86_64/ceph-nautilus/',
)}
end
end
on_supported_os.each do |os, facts|
context "on #{os}" do
let (:facts) do
facts.merge!(OSDefaults.get_facts())
end
it_behaves_like "ceph::repo on #{facts[:osfamily]}"
it_behaves_like "ceph::repo on #{facts[:os]['family']}"
if facts[:operatingsystem] == 'CentOS'
if facts[:os]['name'] == 'CentOS'
it_behaves_like 'ceph::repo on CentOS'
it_behaves_like "ceph::repo on CentOS Stream #{facts[:os]['release']['major']}"
end
end
end

View File

@ -39,7 +39,7 @@ describe 'ceph::fs' do
on_supported_os.each do |os,facts|
context "on #{os}" do
let (:facts) do
facts.merge!(OSDefaults.get_facts({:hostname => 'myhostname'}))
facts.merge!(OSDefaults.get_facts())
end
it_behaves_like 'ceph fs'

View File

@ -26,8 +26,8 @@ describe 'ceph::rgw::apache_proxy_fcgi' do
'radosgw.gateway'
end
it { should contain_apache__vhost('myhost.domain-radosgw').with(
:servername => 'myhost.domain',
it { should contain_apache__vhost('foo.example.com-radosgw').with(
:servername => 'foo.example.com',
:serveradmin => 'root@localhost',
:port => 80,
:docroot => '/var/www',
@ -104,10 +104,7 @@ describe 'ceph::rgw::apache_proxy_fcgi' do
on_supported_os.each do |os, facts|
context "on #{os}" do
let (:facts) do
facts.merge!(OSDefaults.get_facts(
:fqdn => 'myhost.domain',
:hostname => 'myhost'
))
facts.merge!(OSDefaults.get_facts())
end
it_behaves_like 'ceph::rgw::apache_proxy_fcgi'

View File

@ -34,12 +34,12 @@ describe 'ceph::rgw' do
end
it { should contain_ceph_config('client.radosgw.beast/user').with_value("#{platform_params[:user]}") }
it { should contain_ceph_config('client.radosgw.beast/host').with_value('myhost') }
it { should contain_ceph_config('client.radosgw.beast/host').with_value('foo') }
it { should contain_ceph_config('client.radosgw.beast/keyring').with_value('/etc/ceph/ceph.client.radosgw.beast.keyring') }
it { should contain_ceph_config('client.radosgw.beast/log_file').with_value('/var/log/ceph/radosgw.log') }
it { should contain_ceph_config('client.radosgw.beast/rgw_frontends').with_value('beast port=7480') }
it { should contain_ceph_config('client.radosgw.beast/rgw_dns_name').with_value('myhost.domain') }
it { should contain_ceph_config('client.radosgw.beast/rgw_swift_url').with_value('http://myhost.domain:7480') }
it { should contain_ceph_config('client.radosgw.beast/rgw_dns_name').with_value('foo.example.com') }
it { should contain_ceph_config('client.radosgw.beast/rgw_swift_url').with_value('http://foo.example.com:7480') }
end
describe "activated with custom beast params" do
@ -59,7 +59,7 @@ describe 'ceph::rgw' do
it { should contain_ceph_config('client.radosgw.custom/rgw_frontends').with_value('beast endpoint=0.0.0.0:8080 port=8080') }
it { should contain_ceph_config('client.radosgw.custom/user').with_value('root') }
it { should contain_ceph_config('client.radosgw.custom/host').with_value('myhost') }
it { should contain_ceph_config('client.radosgw.custom/host').with_value('foo') }
it { should contain_ceph_config('client.radosgw.custom/keyring').with_value('/etc/ceph/ceph.client.radosgw.custom.keyring') }
it { should contain_ceph_config('client.radosgw.custom/log_file').with_value('/var/log/ceph/radosgw.log') }
it { should contain_ceph_config('client.radosgw.custom/rgw_dns_name').with_value('mydns.hostname') }
@ -70,14 +70,11 @@ describe 'ceph::rgw' do
on_supported_os.each do |os, facts|
context "on #{os}" do
let (:facts) do
facts.merge!(OSDefaults.get_facts(
:fqdn => 'myhost.domain',
:hostname => 'myhost'
))
facts.merge!(OSDefaults.get_facts())
end
let :platform_params do
case facts[:osfamily]
case facts[:os]['family']
when 'Debian'
{
:user => 'www-data',

View File

@ -35,12 +35,12 @@ describe 'ceph::rgw' do
end
it { should contain_ceph_config('client.radosgw.civetweb/user').with_value("#{platform_params[:user]}") }
it { should contain_ceph_config('client.radosgw.civetweb/host').with_value('myhost') }
it { should contain_ceph_config('client.radosgw.civetweb/host').with_value('foo') }
it { should contain_ceph_config('client.radosgw.civetweb/keyring').with_value('/etc/ceph/ceph.client.radosgw.civetweb.keyring') }
it { should contain_ceph_config('client.radosgw.civetweb/log_file').with_value('/var/log/ceph/radosgw.log') }
it { should contain_ceph_config('client.radosgw.civetweb/rgw_frontends').with_value('civetweb port=7480') }
it { should contain_ceph_config('client.radosgw.civetweb/rgw_dns_name').with_value('myhost.domain') }
it { should contain_ceph_config('client.radosgw.civetweb/rgw_swift_url').with_value('http://myhost.domain:7480') }
it { should contain_ceph_config('client.radosgw.civetweb/rgw_dns_name').with_value('foo.example.com') }
it { should contain_ceph_config('client.radosgw.civetweb/rgw_swift_url').with_value('http://foo.example.com:7480') }
end
describe "activated with custom civetweb params" do
@ -60,7 +60,7 @@ describe 'ceph::rgw' do