Bump to Jewel
This patch bumps puppet-ceph to use Jewel, the new LTS that will replace Hammer (previous LTS). * Change defaults repositories to download Jewel by default except on CentOS [1]. * Ensure mon/osd files are created as the ceph user [2] only if ceph user is present on the system (managed by ceph packaging since Jewel). * Rename radosgw service to match with Jewel packaging. * acceptance: configure Ceph to limit OSD object name lengths for ext4. * acceptance: deploy Jewel for Ubuntu and Hammer on CentOS7, packages are not ready for CentOS SIG: http://buildlogs.centos.org/centos/7/storage/x86_64/ceph-jewel/ * acceptance: limit OSD object name lengths for ext4: As of the Ceph Jewel release, certain limitations apply to OSD object name lengths: specifically if ext4 is in use for block devices or a directory based OSD is configured, OSD's must be configured to limit object name length [3]. [1] https://bugs.centos.org/view.php?id=10803 [2] http://docs.ceph.com/docs/master/release-notes/#upgrading-from-hammer [3] Thanks to James Page: https://review.openstack.org/#/c/318612/1 Change-Id: I2ebe0fbab10d04b21c851df64d60b834f4006d3a
This commit is contained in:
parent
a783f01eec
commit
68ea744762
@ -1,6 +1,6 @@
|
||||
---
|
||||
######## Ceph
|
||||
ceph::profile::params::release: 'hammer'
|
||||
ceph::profile::params::release: 'jewel'
|
||||
|
||||
######## Ceph.conf
|
||||
ceph::profile::params::fsid: '4b5c8c0a-ff60-454b-a1b4-9747aa737d19'
|
||||
|
@ -76,21 +76,37 @@ define ceph::mon (
|
||||
$cluster_name = 'ceph'
|
||||
}
|
||||
|
||||
# if Ubuntu does not use systemd
|
||||
$mon_service = "ceph-mon-${id}"
|
||||
|
||||
# For Ubuntu Trusty system
|
||||
if $::service_provider == 'upstart' {
|
||||
$init = 'upstart'
|
||||
Service {
|
||||
name => "ceph-mon-${id}",
|
||||
name => $mon_service,
|
||||
provider => $::ceph::params::service_provider,
|
||||
start => "start ceph-mon id=${id}",
|
||||
stop => "stop ceph-mon id=${id}",
|
||||
status => "status ceph-mon id=${id}",
|
||||
}
|
||||
# Everything else that is supported by puppet-ceph should run systemd.
|
||||
}
|
||||
# For Ubuntu Xenial system
|
||||
# Note: once CentOS7 SIG provides ceph packaging on:
|
||||
# http://buildlogs.centos.org/centos/7/storage/x86_64/ceph-jewel/
|
||||
# then we can drop the Ubuntu conditional.
|
||||
elsif $::service_provider == 'systemd' and $::operatingsystem == 'Ubuntu' {
|
||||
$init = 'systemd'
|
||||
Service {
|
||||
name => $mon_service,
|
||||
provider => $::ceph::params::service_provider,
|
||||
start => "systemctl start ceph-mon@${id}",
|
||||
stop => "systemctl stop ceph-mon@${id}",
|
||||
status => "systemctl status ceph-mon@${id}",
|
||||
}
|
||||
# For Red Hat systems (not supporting Jewel now, only Hammer)
|
||||
} else {
|
||||
$init = 'sysvinit'
|
||||
Service {
|
||||
name => "ceph-mon-${id}",
|
||||
name => $mon_service,
|
||||
provider => $::ceph::params::service_provider,
|
||||
start => "service ceph start mon.${id}",
|
||||
stop => "service ceph stop mon.${id}",
|
||||
@ -98,8 +114,6 @@ define ceph::mon (
|
||||
}
|
||||
}
|
||||
|
||||
$mon_service = "ceph-mon-${id}"
|
||||
|
||||
if $ensure == present {
|
||||
|
||||
$ceph_mkfs = "ceph-mon-mkfs-${id}"
|
||||
@ -166,6 +180,19 @@ set -ex
|
||||
mon_data=\$(ceph-mon ${cluster_option} --id ${id} --show-config-value mon_data)
|
||||
if [ ! -d \$mon_data ] ; then
|
||||
mkdir -p \$mon_data
|
||||
if getent passwd ceph >/dev/null 2>&1; then
|
||||
chown -h ceph:ceph \$mon_data
|
||||
if ceph-mon ${cluster_option} \
|
||||
--setuser ceph --setgroup ceph \
|
||||
--mkfs \
|
||||
--id ${id} \
|
||||
--keyring ${keyring_path} ; then
|
||||
touch \$mon_data/done \$mon_data/${init} \$mon_data/keyring
|
||||
chown -h ceph:ceph \$mon_data/done \$mon_data/${init} \$mon_data/keyring
|
||||
else
|
||||
rm -fr \$mon_data
|
||||
fi
|
||||
else
|
||||
if ceph-mon ${cluster_option} \
|
||||
--mkfs \
|
||||
--id ${id} \
|
||||
@ -175,6 +202,7 @@ if [ ! -d \$mon_data ] ; then
|
||||
rm -fr \$mon_data
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
",
|
||||
unless => "/bin/true # comment to satisfy puppet syntax requirements
|
||||
set -ex
|
||||
|
@ -90,6 +90,9 @@ test -f ${udev_rules_file} && test \$DISABLE_UDEV -eq 1
|
||||
set -ex
|
||||
if ! test -b ${data} ; then
|
||||
mkdir -p ${data}
|
||||
if getent passwd ceph >/dev/null 2>&1; then
|
||||
chown -h ceph:ceph ${data}
|
||||
fi
|
||||
fi
|
||||
ceph-disk prepare ${cluster_option} ${data} ${journal}
|
||||
udevadm settle
|
||||
@ -109,6 +112,9 @@ ceph-disk list | grep -E ' *${data}1? .*ceph data, (prepared|active)' ||
|
||||
set -ex
|
||||
if ! test -b ${data} ; then
|
||||
mkdir -p ${data}
|
||||
if getent passwd ceph >/dev/null 2>&1; then
|
||||
chown -h ceph:ceph ${data}
|
||||
fi
|
||||
fi
|
||||
# activate happens via udev when using the entire device
|
||||
if ! test -b ${data} || ! test -b ${data}1 ; then
|
||||
@ -140,6 +146,7 @@ fi
|
||||
if [ \"\$id\" ] ; then
|
||||
stop ceph-osd cluster=${cluster_name} id=\$id || true
|
||||
service ceph stop osd.\$id || true
|
||||
systemctl stop ceph-osd@\$id || true
|
||||
ceph ${cluster_option} osd crush remove osd.\$id
|
||||
ceph ${cluster_option} auth del osd.\$id
|
||||
ceph ${cluster_option} osd rm \$id
|
||||
|
@ -34,7 +34,7 @@
|
||||
# Optional. Defaults to 'present'.
|
||||
#
|
||||
# [*release*] The name of the Ceph release to install
|
||||
# Optional. Default to 'hammer'.
|
||||
# Optional. Default to 'jewel'.
|
||||
#
|
||||
# [*fastcgi*] Install Ceph fastcgi apache module for Ceph
|
||||
# Optional. Defaults to 'false'
|
||||
@ -58,7 +58,7 @@
|
||||
#
|
||||
class ceph::repo (
|
||||
$ensure = present,
|
||||
$release = 'hammer',
|
||||
$release = 'jewel',
|
||||
$fastcgi = false,
|
||||
$proxy = undef,
|
||||
$proxy_username = undef,
|
||||
@ -114,6 +114,8 @@ class ceph::repo (
|
||||
if $::operatingsystem != 'CentOS' {
|
||||
warning("CentOS SIG repository is only supported on CentOS operating system, not on ${::operatingsystem}, which can lead to packaging issues.")
|
||||
}
|
||||
# Bump to Jewel once this bug is solved:
|
||||
# https://bugs.centos.org/view.php?id=10803
|
||||
exec { 'installing_centos-release-ceph':
|
||||
command => '/usr/bin/yum install -y centos-release-ceph-hammer',
|
||||
logoutput => 'on_failure',
|
||||
|
3
releasenotes/notes/jewel-218ac52343f4e165.yaml
Normal file
3
releasenotes/notes/jewel-218ac52343f4e165.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
---
|
||||
prelude: >
|
||||
This is the first release that will support Ceph Jewel deployments.
|
@ -21,7 +21,12 @@ require 'spec_helper_acceptance'
|
||||
|
||||
describe 'ceph rgw/civetweb' do
|
||||
|
||||
if os[:family].casecmp('RedHat') == 0
|
||||
release = 'hammer'
|
||||
else
|
||||
release = 'jewel'
|
||||
end
|
||||
|
||||
fsid = 'a4807c9a-e76f-4666-a297-6d6cbc922e3a'
|
||||
mon_key ='AQCztJdSyNb0NBAASA2yPZPuwXeIQnDJ9O8gVw=='
|
||||
admin_key = 'AQA0TVRTsP/aHxAAFBvntu1dSEJHxtJeFFrRsg=='
|
||||
|
@ -19,7 +19,12 @@ require 'spec_helper_acceptance'
|
||||
|
||||
describe 'ceph rgw' do
|
||||
|
||||
if os[:family].casecmp('RedHat') == 0
|
||||
release = 'hammer'
|
||||
else
|
||||
release = 'jewel'
|
||||
end
|
||||
|
||||
fsid = 'a4807c9a-e76f-4666-a297-6d6cbc922e3a'
|
||||
mon_key ='AQCztJdSyNb0NBAASA2yPZPuwXeIQnDJ9O8gVw=='
|
||||
admin_key = 'AQA0TVRTsP/aHxAAFBvntu1dSEJHxtJeFFrRsg=='
|
||||
|
@ -22,11 +22,19 @@ describe 'ceph usecases' do
|
||||
# passing it directly as unqoted array is not supported everywhere
|
||||
packages = "[ 'python-ceph', 'ceph-common', 'librados2', 'librbd1', 'libcephfs1' ]"
|
||||
|
||||
if os[:family].casecmp('RedHat') == 0
|
||||
release = 'hammer'
|
||||
else
|
||||
release = 'jewel'
|
||||
end
|
||||
|
||||
describe 'I want to try this module, heard of ceph, want to see it in action' do
|
||||
|
||||
it 'should install one monitor and one OSD on /srv/data' do
|
||||
pp = <<-EOS
|
||||
class { 'ceph::repo': }
|
||||
class { 'ceph::repo':
|
||||
release => #{release},
|
||||
}
|
||||
class { 'ceph':
|
||||
fsid => '82274746-9a2c-426b-8c51-107fb0d890c6',
|
||||
mon_host => $::ipaddress,
|
||||
@ -36,6 +44,8 @@ describe 'ceph usecases' do
|
||||
}
|
||||
ceph_config {
|
||||
'global/osd_journal_size': value => '100';
|
||||
'global/osd_max_object_namespace_len': value => '64';
|
||||
'global/osd_max_object_name_len': value => '256';
|
||||
}
|
||||
ceph::mon { 'a':
|
||||
public_addr => $::ipaddress,
|
||||
@ -100,8 +110,8 @@ describe 'ceph usecases' do
|
||||
end
|
||||
end
|
||||
if osfamily == 'RedHat'
|
||||
shell 'service ceph status mon.a', { :acceptable_exit_codes => [1] } do |r|
|
||||
expect(r.stdout).to match(/mon.a not found/)
|
||||
shell 'systemctl status ceph-mon@a', { :acceptable_exit_codes => [1] } do |r|
|
||||
expect(r.stdout).to match(/Active: inactive/)
|
||||
expect(r.stderr).to be_empty
|
||||
end
|
||||
end
|
||||
|
@ -39,7 +39,7 @@ describe 'ceph::repo' do
|
||||
) }
|
||||
|
||||
it { is_expected.to contain_apt__source('ceph').with(
|
||||
:location => 'http://download.ceph.com/debian-hammer/',
|
||||
:location => 'http://download.ceph.com/debian-jewel/',
|
||||
:release => 'jessie',
|
||||
:require => 'Apt::Key[ceph]'
|
||||
) }
|
||||
@ -81,7 +81,7 @@ describe 'ceph::repo' do
|
||||
) }
|
||||
|
||||
it { is_expected.to contain_apt__source('ceph').with(
|
||||
:location => 'http://download.ceph.com/debian-hammer/',
|
||||
:location => 'http://download.ceph.com/debian-jewel/',
|
||||
:release => 'trusty',
|
||||
:require => 'Apt::Key[ceph]'
|
||||
) }
|
||||
@ -115,7 +115,7 @@ describe 'ceph::repo' do
|
||||
) }
|
||||
|
||||
it { is_expected.to contain_apt__source('ceph').with(
|
||||
:location => 'http://download.ceph.com/debian-hammer/',
|
||||
:location => 'http://download.ceph.com/debian-jewel/',
|
||||
:release => 'trusty',
|
||||
:require => 'Apt::Key[ceph]'
|
||||
) }
|
||||
@ -139,7 +139,7 @@ describe 'ceph::repo' do
|
||||
|
||||
it { is_expected.to contain_apt__source('ceph').with(
|
||||
:ensure => 'absent',
|
||||
:location => 'http://download.ceph.com/debian-hammer/',
|
||||
:location => 'http://download.ceph.com/debian-jewel/',
|
||||
:release => 'trusty',
|
||||
:require => 'Apt::Key[ceph]'
|
||||
) }
|
||||
@ -183,9 +183,9 @@ describe 'ceph::repo' do
|
||||
|
||||
it { is_expected.to contain_yumrepo('ext-ceph').with(
|
||||
:enabled => '1',
|
||||
:descr => 'External Ceph hammer',
|
||||
:name => 'ext-ceph-hammer',
|
||||
:baseurl => 'http://download.ceph.com/rpm-hammer/el7/$basearch',
|
||||
:descr => 'External Ceph jewel',
|
||||
:name => 'ext-ceph-jewel',
|
||||
:baseurl => 'http://download.ceph.com/rpm-jewel/el7/$basearch',
|
||||
:gpgcheck => '1',
|
||||
:gpgkey => 'https://download.ceph.com/keys/release.asc',
|
||||
:mirrorlist => 'absent',
|
||||
@ -195,8 +195,8 @@ describe 'ceph::repo' do
|
||||
it { is_expected.to contain_yumrepo('ext-ceph-noarch').with(
|
||||
:enabled => '1',
|
||||
:descr => 'External Ceph noarch',
|
||||
:name => 'ext-ceph-hammer-noarch',
|
||||
:baseurl => 'http://download.ceph.com/rpm-hammer/el7/noarch',
|
||||
:name => 'ext-ceph-jewel-noarch',
|
||||
:baseurl => 'http://download.ceph.com/rpm-jewel/el7/noarch',
|
||||
:gpgcheck => '1',
|
||||
:gpgkey => 'https://download.ceph.com/keys/release.asc',
|
||||
:mirrorlist => 'absent',
|
||||
@ -286,9 +286,9 @@ describe 'ceph::repo' do
|
||||
|
||||
it { is_expected.to contain_yumrepo('ext-ceph').with(
|
||||
:enabled => '1',
|
||||
:descr => 'External Ceph hammer',
|
||||
:name => 'ext-ceph-hammer',
|
||||
:baseurl => 'http://download.ceph.com/rpm-hammer/el7/$basearch',
|
||||
:descr => 'External Ceph jewel',
|
||||
:name => 'ext-ceph-jewel',
|
||||
:baseurl => 'http://download.ceph.com/rpm-jewel/el7/$basearch',
|
||||
:gpgcheck => '1',
|
||||
:gpgkey => 'https://download.ceph.com/keys/release.asc',
|
||||
:mirrorlist => 'absent',
|
||||
@ -301,8 +301,8 @@ describe 'ceph::repo' do
|
||||
it { is_expected.to contain_yumrepo('ext-ceph-noarch').with(
|
||||
:enabled => '1',
|
||||
:descr => 'External Ceph noarch',
|
||||
:name => 'ext-ceph-hammer-noarch',
|
||||
:baseurl => 'http://download.ceph.com/rpm-hammer/el7/noarch',
|
||||
:name => 'ext-ceph-jewel-noarch',
|
||||
:baseurl => 'http://download.ceph.com/rpm-jewel/el7/noarch',
|
||||
:gpgcheck => '1',
|
||||
:gpgkey => 'https://download.ceph.com/keys/release.asc',
|
||||
:mirrorlist => 'absent',
|
||||
@ -337,9 +337,9 @@ describe 'ceph::repo' do
|
||||
|
||||
it { is_expected.to contain_yumrepo('ext-ceph').with(
|
||||
:enabled => '0',
|
||||
:descr => 'External Ceph hammer',
|
||||
:name => 'ext-ceph-hammer',
|
||||
:baseurl => 'http://download.ceph.com/rpm-hammer/el7/$basearch',
|
||||
:descr => 'External Ceph jewel',
|
||||
:name => 'ext-ceph-jewel',
|
||||
:baseurl => 'http://download.ceph.com/rpm-jewel/el7/$basearch',
|
||||
:gpgcheck => '1',
|
||||
:gpgkey => 'https://download.ceph.com/keys/release.asc',
|
||||
:mirrorlist => 'absent',
|
||||
@ -349,8 +349,8 @@ describe 'ceph::repo' do
|
||||
it { is_expected.to contain_yumrepo('ext-ceph-noarch').with(
|
||||
:enabled => '0',
|
||||
:descr => 'External Ceph noarch',
|
||||
:name => 'ext-ceph-hammer-noarch',
|
||||
:baseurl => 'http://download.ceph.com/rpm-hammer/el7/noarch',
|
||||
:name => 'ext-ceph-jewel-noarch',
|
||||
:baseurl => 'http://download.ceph.com/rpm-jewel/el7/noarch',
|
||||
:gpgcheck => '1',
|
||||
:gpgkey => 'https://download.ceph.com/keys/release.asc',
|
||||
:mirrorlist => 'absent',
|
||||
@ -393,9 +393,9 @@ describe 'ceph::repo' do
|
||||
|
||||
it { is_expected.to contain_yumrepo('ext-ceph').with(
|
||||
:enabled => '1',
|
||||
:descr => 'External Ceph hammer',
|
||||
:name => 'ext-ceph-hammer',
|
||||
:baseurl => 'http://download.ceph.com/rpm-hammer/el7/$basearch',
|
||||
:descr => 'External Ceph jewel',
|
||||
:name => 'ext-ceph-jewel',
|
||||
:baseurl => 'http://download.ceph.com/rpm-jewel/el7/$basearch',
|
||||
:gpgcheck => '1',
|
||||
:gpgkey => 'https://download.ceph.com/keys/release.asc',
|
||||
:mirrorlist => 'absent',
|
||||
@ -405,8 +405,8 @@ describe 'ceph::repo' do
|
||||
it { is_expected.to contain_yumrepo('ext-ceph-noarch').with(
|
||||
:enabled => '1',
|
||||
:descr => 'External Ceph noarch',
|
||||
:name => 'ext-ceph-hammer-noarch',
|
||||
:baseurl => 'http://download.ceph.com/rpm-hammer/el7/noarch',
|
||||
:name => 'ext-ceph-jewel-noarch',
|
||||
:baseurl => 'http://download.ceph.com/rpm-jewel/el7/noarch',
|
||||
:gpgcheck => '1',
|
||||
:gpgkey => 'https://download.ceph.com/keys/release.asc',
|
||||
:mirrorlist => 'absent',
|
||||
@ -455,9 +455,9 @@ describe 'ceph::repo' do
|
||||
|
||||
it { is_expected.to contain_yumrepo('ext-ceph').with(
|
||||
:enabled => '1',
|
||||
:descr => 'External Ceph hammer',
|
||||
:name => 'ext-ceph-hammer',
|
||||
:baseurl => 'http://download.ceph.com/rpm-hammer/el7/$basearch',
|
||||
:descr => 'External Ceph jewel',
|
||||
:name => 'ext-ceph-jewel',
|
||||
:baseurl => 'http://download.ceph.com/rpm-jewel/el7/$basearch',
|
||||
:gpgcheck => '1',
|
||||
:gpgkey => 'https://download.ceph.com/keys/release.asc',
|
||||
:mirrorlist => 'absent',
|
||||
@ -467,8 +467,8 @@ describe 'ceph::repo' do
|
||||
it { is_expected.to contain_yumrepo('ext-ceph-noarch').with(
|
||||
:enabled => '1',
|
||||
:descr => 'External Ceph noarch',
|
||||
:name => 'ext-ceph-hammer-noarch',
|
||||
:baseurl => 'http://download.ceph.com/rpm-hammer/el7/noarch',
|
||||
:name => 'ext-ceph-jewel-noarch',
|
||||
:baseurl => 'http://download.ceph.com/rpm-jewel/el7/noarch',
|
||||
:gpgcheck => '1',
|
||||
:gpgkey => 'https://download.ceph.com/keys/release.asc',
|
||||
:mirrorlist => 'absent',
|
||||
@ -569,9 +569,9 @@ describe 'ceph::repo' do
|
||||
|
||||
it { is_expected.to contain_yumrepo('ext-ceph').with(
|
||||
:enabled => '0',
|
||||
:descr => 'External Ceph hammer',
|
||||
:name => 'ext-ceph-hammer',
|
||||
:baseurl => 'http://download.ceph.com/rpm-hammer/el7/$basearch',
|
||||
:descr => 'External Ceph jewel',
|
||||
:name => 'ext-ceph-jewel',
|
||||
:baseurl => 'http://download.ceph.com/rpm-jewel/el7/$basearch',
|
||||
:gpgcheck => '1',
|
||||
:gpgkey => 'https://download.ceph.com/keys/release.asc',
|
||||
:mirrorlist => 'absent',
|
||||
@ -581,8 +581,8 @@ describe 'ceph::repo' do
|
||||
it { is_expected.to contain_yumrepo('ext-ceph-noarch').with(
|
||||
:enabled => '0',
|
||||
:descr => 'External Ceph noarch',
|
||||
:name => 'ext-ceph-hammer-noarch',
|
||||
:baseurl => 'http://download.ceph.com/rpm-hammer/el7/noarch',
|
||||
:name => 'ext-ceph-jewel-noarch',
|
||||
:baseurl => 'http://download.ceph.com/rpm-jewel/el7/noarch',
|
||||
:gpgcheck => '1',
|
||||
:gpgkey => 'https://download.ceph.com/keys/release.asc',
|
||||
:mirrorlist => 'absent',
|
||||
@ -625,9 +625,9 @@ describe 'ceph::repo' do
|
||||
|
||||
it { is_expected.to contain_yumrepo('ext-ceph').with(
|
||||
:enabled => '1',
|
||||
:descr => 'External Ceph hammer',
|
||||
:name => 'ext-ceph-hammer',
|
||||
:baseurl => 'http://download.ceph.com/rpm-hammer/el7/$basearch',
|
||||
:descr => 'External Ceph jewel',
|
||||
:name => 'ext-ceph-jewel',
|
||||
:baseurl => 'http://download.ceph.com/rpm-jewel/el7/$basearch',
|
||||
:gpgcheck => '1',
|
||||
:gpgkey => 'https://download.ceph.com/keys/release.asc',
|
||||
:mirrorlist => 'absent',
|
||||
@ -637,8 +637,8 @@ describe 'ceph::repo' do
|
||||
it { is_expected.to contain_yumrepo('ext-ceph-noarch').with(
|
||||
:enabled => '1',
|
||||
:descr => 'External Ceph noarch',
|
||||
:name => 'ext-ceph-hammer-noarch',
|
||||
:baseurl => 'http://download.ceph.com/rpm-hammer/el7/noarch',
|
||||
:name => 'ext-ceph-jewel-noarch',
|
||||
:baseurl => 'http://download.ceph.com/rpm-jewel/el7/noarch',
|
||||
:gpgcheck => '1',
|
||||
:gpgkey => 'https://download.ceph.com/keys/release.asc',
|
||||
:mirrorlist => 'absent',
|
||||
|
@ -86,6 +86,19 @@ set -ex
|
||||
mon_data=\$(ceph-mon --id A --show-config-value mon_data)
|
||||
if [ ! -d \$mon_data ] ; then
|
||||
mkdir -p \$mon_data
|
||||
if getent passwd ceph >/dev/null 2>&1; then
|
||||
chown -h ceph:ceph \$mon_data
|
||||
if ceph-mon \
|
||||
--setuser ceph --setgroup ceph \
|
||||
--mkfs \
|
||||
--id A \
|
||||
--keyring /tmp/ceph-mon-keyring-A ; then
|
||||
touch \$mon_data/done \$mon_data/upstart \$mon_data/keyring
|
||||
chown -h ceph:ceph \$mon_data/done \$mon_data/upstart \$mon_data/keyring
|
||||
else
|
||||
rm -fr \$mon_data
|
||||
fi
|
||||
else
|
||||
if ceph-mon \
|
||||
--mkfs \
|
||||
--id A \
|
||||
@ -95,6 +108,7 @@ if [ ! -d \$mon_data ] ; then
|
||||
rm -fr \$mon_data
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
",
|
||||
'logoutput' => true) }
|
||||
it { is_expected.to contain_exec('rm-keyring-A').with('command' => '/bin/rm /tmp/ceph-mon-keyring-A') }
|
||||
@ -124,6 +138,19 @@ set -ex
|
||||
mon_data=\$(ceph-mon --id A --show-config-value mon_data)
|
||||
if [ ! -d \$mon_data ] ; then
|
||||
mkdir -p \$mon_data
|
||||
if getent passwd ceph >/dev/null 2>&1; then
|
||||
chown -h ceph:ceph \$mon_data
|
||||
if ceph-mon \
|
||||
--setuser ceph --setgroup ceph \
|
||||
--mkfs \
|
||||
--id A \
|
||||
--keyring /etc/ceph/ceph.mon.keyring ; then
|
||||
touch \$mon_data/done \$mon_data/upstart \$mon_data/keyring
|
||||
chown -h ceph:ceph \$mon_data/done \$mon_data/upstart \$mon_data/keyring
|
||||
else
|
||||
rm -fr \$mon_data
|
||||
fi
|
||||
else
|
||||
if ceph-mon \
|
||||
--mkfs \
|
||||
--id A \
|
||||
@ -133,6 +160,7 @@ if [ ! -d \$mon_data ] ; then
|
||||
rm -fr \$mon_data
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
",
|
||||
'logoutput' => true) }
|
||||
end
|
||||
@ -164,6 +192,19 @@ set -ex
|
||||
mon_data=\$(ceph-mon --cluster testcluster --id A --show-config-value mon_data)
|
||||
if [ ! -d \$mon_data ] ; then
|
||||
mkdir -p \$mon_data
|
||||
if getent passwd ceph >/dev/null 2>&1; then
|
||||
chown -h ceph:ceph \$mon_data
|
||||
if ceph-mon --cluster testcluster \
|
||||
--setuser ceph --setgroup ceph \
|
||||
--mkfs \
|
||||
--id A \
|
||||
--keyring /dev/null ; then
|
||||
touch \$mon_data/done \$mon_data/upstart \$mon_data/keyring
|
||||
chown -h ceph:ceph \$mon_data/done \$mon_data/upstart \$mon_data/keyring
|
||||
else
|
||||
rm -fr \$mon_data
|
||||
fi
|
||||
else
|
||||
if ceph-mon --cluster testcluster \
|
||||
--mkfs \
|
||||
--id A \
|
||||
@ -173,6 +214,7 @@ if [ ! -d \$mon_data ] ; then
|
||||
rm -fr \$mon_data
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
",
|
||||
'logoutput' => true) }
|
||||
end
|
||||
@ -273,15 +315,29 @@ set -ex
|
||||
mon_data=\$(ceph-mon --id A --show-config-value mon_data)
|
||||
if [ ! -d \$mon_data ] ; then
|
||||
mkdir -p \$mon_data
|
||||
if getent passwd ceph >/dev/null 2>&1; then
|
||||
chown -h ceph:ceph \$mon_data
|
||||
if ceph-mon \
|
||||
--setuser ceph --setgroup ceph \
|
||||
--mkfs \
|
||||
--id A \
|
||||
--keyring /tmp/ceph-mon-keyring-A ; then
|
||||
touch \$mon_data/done \$mon_data/systemd \$mon_data/keyring
|
||||
chown -h ceph:ceph \$mon_data/done \$mon_data/systemd \$mon_data/keyring
|
||||
else
|
||||
rm -fr \$mon_data
|
||||
fi
|
||||
else
|
||||
if ceph-mon \
|
||||
--mkfs \
|
||||
--id A \
|
||||
--keyring /tmp/ceph-mon-keyring-A ; then
|
||||
touch \$mon_data/done \$mon_data/sysvinit \$mon_data/keyring
|
||||
touch \$mon_data/done \$mon_data/systemd \$mon_data/keyring
|
||||
else
|
||||
rm -fr \$mon_data
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
",
|
||||
'logoutput' => true) }
|
||||
it { is_expected.to contain_exec('rm-keyring-A').with('command' => '/bin/rm /tmp/ceph-mon-keyring-A') }
|
||||
@ -311,15 +367,29 @@ set -ex
|
||||
mon_data=\$(ceph-mon --id A --show-config-value mon_data)
|
||||
if [ ! -d \$mon_data ] ; then
|
||||
mkdir -p \$mon_data
|
||||
if getent passwd ceph >/dev/null 2>&1; then
|
||||
chown -h ceph:ceph \$mon_data
|
||||
if ceph-mon \
|
||||
--setuser ceph --setgroup ceph \
|
||||
--mkfs \
|
||||
--id A \
|
||||
--keyring /etc/ceph/ceph.mon.keyring ; then
|
||||
touch \$mon_data/done \$mon_data/systemd \$mon_data/keyring
|
||||
chown -h ceph:ceph \$mon_data/done \$mon_data/systemd \$mon_data/keyring
|
||||
else
|
||||
rm -fr \$mon_data
|
||||
fi
|
||||
else
|
||||
if ceph-mon \
|
||||
--mkfs \
|
||||
--id A \
|
||||
--keyring /etc/ceph/ceph.mon.keyring ; then
|
||||
touch \$mon_data/done \$mon_data/sysvinit \$mon_data/keyring
|
||||
touch \$mon_data/done \$mon_data/systemd \$mon_data/keyring
|
||||
else
|
||||
rm -fr \$mon_data
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
",
|
||||
'logoutput' => true) }
|
||||
end
|
||||
@ -351,15 +421,29 @@ set -ex
|
||||
mon_data=\$(ceph-mon --cluster testcluster --id A --show-config-value mon_data)
|
||||
if [ ! -d \$mon_data ] ; then
|
||||
mkdir -p \$mon_data
|
||||
if getent passwd ceph >/dev/null 2>&1; then
|
||||
chown -h ceph:ceph \$mon_data
|
||||
if ceph-mon --cluster testcluster \
|
||||
--setuser ceph --setgroup ceph \
|
||||
--mkfs \
|
||||
--id A \
|
||||
--keyring /dev/null ; then
|
||||
touch \$mon_data/done \$mon_data/systemd \$mon_data/keyring
|
||||
chown -h ceph:ceph \$mon_data/done \$mon_data/systemd \$mon_data/keyring
|
||||
else
|
||||
rm -fr \$mon_data
|
||||
fi
|
||||
else
|
||||
if ceph-mon --cluster testcluster \
|
||||
--mkfs \
|
||||
--id A \
|
||||
--keyring /dev/null ; then
|
||||
touch \$mon_data/done \$mon_data/sysvinit \$mon_data/keyring
|
||||
touch \$mon_data/done \$mon_data/systemd \$mon_data/keyring
|
||||
else
|
||||
rm -fr \$mon_data
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
",
|
||||
'logoutput' => true) }
|
||||
end
|
||||
@ -461,6 +545,19 @@ set -ex
|
||||
mon_data=\$(ceph-mon --id A --show-config-value mon_data)
|
||||
if [ ! -d \$mon_data ] ; then
|
||||
mkdir -p \$mon_data
|
||||
if getent passwd ceph >/dev/null 2>&1; then
|
||||
chown -h ceph:ceph \$mon_data
|
||||
if ceph-mon \
|
||||
--setuser ceph --setgroup ceph \
|
||||
--mkfs \
|
||||
--id A \
|
||||
--keyring /tmp/ceph-mon-keyring-A ; then
|
||||
touch \$mon_data/done \$mon_data/sysvinit \$mon_data/keyring
|
||||
chown -h ceph:ceph \$mon_data/done \$mon_data/sysvinit \$mon_data/keyring
|
||||
else
|
||||
rm -fr \$mon_data
|
||||
fi
|
||||
else
|
||||
if ceph-mon \
|
||||
--mkfs \
|
||||
--id A \
|
||||
@ -470,6 +567,7 @@ if [ ! -d \$mon_data ] ; then
|
||||
rm -fr \$mon_data
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
",
|
||||
'logoutput' => true) }
|
||||
it { is_expected.to contain_exec('rm-keyring-A').with(
|
||||
@ -504,6 +602,19 @@ set -ex
|
||||
mon_data=\$(ceph-mon --id A --show-config-value mon_data)
|
||||
if [ ! -d \$mon_data ] ; then
|
||||
mkdir -p \$mon_data
|
||||
if getent passwd ceph >/dev/null 2>&1; then
|
||||
chown -h ceph:ceph \$mon_data
|
||||
if ceph-mon \
|
||||
--setuser ceph --setgroup ceph \
|
||||
--mkfs \
|
||||
--id A \
|
||||
--keyring /etc/ceph/ceph.mon.keyring ; then
|
||||
touch \$mon_data/done \$mon_data/sysvinit \$mon_data/keyring
|
||||
chown -h ceph:ceph \$mon_data/done \$mon_data/sysvinit \$mon_data/keyring
|
||||
else
|
||||
rm -fr \$mon_data
|
||||
fi
|
||||
else
|
||||
if ceph-mon \
|
||||
--mkfs \
|
||||
--id A \
|
||||
@ -513,6 +624,7 @@ if [ ! -d \$mon_data ] ; then
|
||||
rm -fr \$mon_data
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
",
|
||||
'logoutput' => true) }
|
||||
end
|
||||
@ -544,6 +656,19 @@ set -ex
|
||||
mon_data=\$(ceph-mon --cluster testcluster --id A --show-config-value mon_data)
|
||||
if [ ! -d \$mon_data ] ; then
|
||||
mkdir -p \$mon_data
|
||||
if getent passwd ceph >/dev/null 2>&1; then
|
||||
chown -h ceph:ceph \$mon_data
|
||||
if ceph-mon --cluster testcluster \
|
||||
--setuser ceph --setgroup ceph \
|
||||
--mkfs \
|
||||
--id A \
|
||||
--keyring /dev/null ; then
|
||||
touch \$mon_data/done \$mon_data/sysvinit \$mon_data/keyring
|
||||
chown -h ceph:ceph \$mon_data/done \$mon_data/sysvinit \$mon_data/keyring
|
||||
else
|
||||
rm -fr \$mon_data
|
||||
fi
|
||||
else
|
||||
if ceph-mon --cluster testcluster \
|
||||
--mkfs \
|
||||
--id A \
|
||||
@ -553,6 +678,7 @@ if [ ! -d \$mon_data ] ; then
|
||||
rm -fr \$mon_data
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
",
|
||||
'logoutput' => true) }
|
||||
end
|
||||
|
@ -47,6 +47,9 @@ test -f /usr/lib/udev/rules.d/95-ceph-osd.rules && test \$DISABLE_UDEV -eq 1
|
||||
set -ex
|
||||
if ! test -b /srv ; then
|
||||
mkdir -p /srv
|
||||
if getent passwd ceph >/dev/null 2>&1; then
|
||||
chown -h ceph:ceph /srv
|
||||
fi
|
||||
fi
|
||||
ceph-disk prepare /srv
|
||||
udevadm settle
|
||||
@ -63,6 +66,9 @@ ceph-disk list | grep -E ' */srv1? .*ceph data, (prepared|active)' ||
|
||||
set -ex
|
||||
if ! test -b /srv ; then
|
||||
mkdir -p /srv
|
||||
if getent passwd ceph >/dev/null 2>&1; then
|
||||
chown -h ceph:ceph /srv
|
||||
fi
|
||||
fi
|
||||
# activate happens via udev when using the entire device
|
||||
if ! test -b /srv || ! test -b /srv1 ; then
|
||||
@ -111,6 +117,9 @@ test -f /usr/lib/udev/rules.d/95-ceph-osd.rules && test \$DISABLE_UDEV -eq 1
|
||||
set -ex
|
||||
if ! test -b /srv/data ; then
|
||||
mkdir -p /srv/data
|
||||
if getent passwd ceph >/dev/null 2>&1; then
|
||||
chown -h ceph:ceph /srv/data
|
||||
fi
|
||||
fi
|
||||
ceph-disk prepare --cluster testcluster /srv/data /srv/journal
|
||||
udevadm settle
|
||||
@ -127,6 +136,9 @@ ceph-disk list | grep -E ' */srv/data1? .*ceph data, (prepared|active)' ||
|
||||
set -ex
|
||||
if ! test -b /srv/data ; then
|
||||
mkdir -p /srv/data
|
||||
if getent passwd ceph >/dev/null 2>&1; then
|
||||
chown -h ceph:ceph /srv/data
|
||||
fi
|
||||
fi
|
||||
# activate happens via udev when using the entire device
|
||||
if ! test -b /srv/data || ! test -b /srv/data1 ; then
|
||||
@ -168,6 +180,7 @@ fi
|
||||
if [ \"\$id\" ] ; then
|
||||
stop ceph-osd cluster=ceph id=\$id || true
|
||||
service ceph stop osd.\$id || true
|
||||
systemctl stop ceph-osd@$id || true
|
||||
ceph osd crush remove osd.\$id
|
||||
ceph auth del osd.\$id
|
||||
ceph osd rm \$id
|
||||
|
2
spec/fixtures/hieradata/common.yaml
vendored
2
spec/fixtures/hieradata/common.yaml
vendored
@ -1,6 +1,6 @@
|
||||
---
|
||||
######## Ceph
|
||||
ceph::profile::params::release: 'hammer'
|
||||
ceph::profile::params::release: 'jewel'
|
||||
|
||||
######## Ceph.conf
|
||||
ceph::profile::params::fsid: '4b5c8c0a-ff60-454b-a1b4-9747aa737d19'
|
||||
|
Loading…
Reference in New Issue
Block a user