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:
Emilien Macchi 2016-05-06 14:11:06 -04:00
parent a783f01eec
commit 68ea744762
12 changed files with 350 additions and 151 deletions

View File

@ -1,6 +1,6 @@
--- ---
######## Ceph ######## Ceph
ceph::profile::params::release: 'hammer' ceph::profile::params::release: 'jewel'
######## Ceph.conf ######## Ceph.conf
ceph::profile::params::fsid: '4b5c8c0a-ff60-454b-a1b4-9747aa737d19' ceph::profile::params::fsid: '4b5c8c0a-ff60-454b-a1b4-9747aa737d19'

View File

@ -76,21 +76,37 @@ define ceph::mon (
$cluster_name = 'ceph' $cluster_name = 'ceph'
} }
# if Ubuntu does not use systemd $mon_service = "ceph-mon-${id}"
# For Ubuntu Trusty system
if $::service_provider == 'upstart' { if $::service_provider == 'upstart' {
$init = 'upstart' $init = 'upstart'
Service { Service {
name => "ceph-mon-${id}", name => $mon_service,
provider => $::ceph::params::service_provider, provider => $::ceph::params::service_provider,
start => "start ceph-mon id=${id}", start => "start ceph-mon id=${id}",
stop => "stop ceph-mon id=${id}", stop => "stop ceph-mon id=${id}",
status => "status 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 { } else {
$init = 'sysvinit' $init = 'sysvinit'
Service { Service {
name => "ceph-mon-${id}", name => $mon_service,
provider => $::ceph::params::service_provider, provider => $::ceph::params::service_provider,
start => "service ceph start mon.${id}", start => "service ceph start mon.${id}",
stop => "service ceph stop mon.${id}", stop => "service ceph stop mon.${id}",
@ -98,8 +114,6 @@ define ceph::mon (
} }
} }
$mon_service = "ceph-mon-${id}"
if $ensure == present { if $ensure == present {
$ceph_mkfs = "ceph-mon-mkfs-${id}" $ceph_mkfs = "ceph-mon-mkfs-${id}"
@ -165,15 +179,29 @@ test -e /etc/ceph/${cluster_name}.client.admin.keyring",
set -ex set -ex
mon_data=\$(ceph-mon ${cluster_option} --id ${id} --show-config-value mon_data) mon_data=\$(ceph-mon ${cluster_option} --id ${id} --show-config-value mon_data)
if [ ! -d \$mon_data ] ; then if [ ! -d \$mon_data ] ; then
mkdir -p \$mon_data mkdir -p \$mon_data
if ceph-mon ${cluster_option} \ if getent passwd ceph >/dev/null 2>&1; then
--mkfs \ chown -h ceph:ceph \$mon_data
--id ${id} \ if ceph-mon ${cluster_option} \
--keyring ${keyring_path} ; then --setuser ceph --setgroup ceph \
touch \$mon_data/done \$mon_data/${init} \$mon_data/keyring --mkfs \
else --id ${id} \
rm -fr \$mon_data --keyring ${keyring_path} ; then
fi 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} \
--keyring ${keyring_path} ; then
touch \$mon_data/done \$mon_data/${init} \$mon_data/keyring
else
rm -fr \$mon_data
fi
fi
fi fi
", ",
unless => "/bin/true # comment to satisfy puppet syntax requirements unless => "/bin/true # comment to satisfy puppet syntax requirements

View File

@ -89,7 +89,10 @@ test -f ${udev_rules_file} && test \$DISABLE_UDEV -eq 1
command => "/bin/true # comment to satisfy puppet syntax requirements command => "/bin/true # comment to satisfy puppet syntax requirements
set -ex set -ex
if ! test -b ${data} ; then if ! test -b ${data} ; then
mkdir -p ${data} mkdir -p ${data}
if getent passwd ceph >/dev/null 2>&1; then
chown -h ceph:ceph ${data}
fi
fi fi
ceph-disk prepare ${cluster_option} ${data} ${journal} ceph-disk prepare ${cluster_option} ${data} ${journal}
udevadm settle udevadm settle
@ -108,7 +111,10 @@ ceph-disk list | grep -E ' *${data}1? .*ceph data, (prepared|active)' ||
command => "/bin/true # comment to satisfy puppet syntax requirements command => "/bin/true # comment to satisfy puppet syntax requirements
set -ex set -ex
if ! test -b ${data} ; then if ! test -b ${data} ; then
mkdir -p ${data} mkdir -p ${data}
if getent passwd ceph >/dev/null 2>&1; then
chown -h ceph:ceph ${data}
fi
fi fi
# activate happens via udev when using the entire device # activate happens via udev when using the entire device
if ! test -b ${data} || ! test -b ${data}1 ; then if ! test -b ${data} || ! test -b ${data}1 ; then
@ -140,6 +146,7 @@ fi
if [ \"\$id\" ] ; then if [ \"\$id\" ] ; then
stop ceph-osd cluster=${cluster_name} id=\$id || true stop ceph-osd cluster=${cluster_name} id=\$id || true
service ceph stop osd.\$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} osd crush remove osd.\$id
ceph ${cluster_option} auth del osd.\$id ceph ${cluster_option} auth del osd.\$id
ceph ${cluster_option} osd rm \$id ceph ${cluster_option} osd rm \$id

View File

@ -34,7 +34,7 @@
# Optional. Defaults to 'present'. # Optional. Defaults to 'present'.
# #
# [*release*] The name of the Ceph release to install # [*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 # [*fastcgi*] Install Ceph fastcgi apache module for Ceph
# Optional. Defaults to 'false' # Optional. Defaults to 'false'
@ -58,7 +58,7 @@
# #
class ceph::repo ( class ceph::repo (
$ensure = present, $ensure = present,
$release = 'hammer', $release = 'jewel',
$fastcgi = false, $fastcgi = false,
$proxy = undef, $proxy = undef,
$proxy_username = undef, $proxy_username = undef,
@ -114,6 +114,8 @@ class ceph::repo (
if $::operatingsystem != 'CentOS' { if $::operatingsystem != 'CentOS' {
warning("CentOS SIG repository is only supported on CentOS operating system, not on ${::operatingsystem}, which can lead to packaging issues.") 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': exec { 'installing_centos-release-ceph':
command => '/usr/bin/yum install -y centos-release-ceph-hammer', command => '/usr/bin/yum install -y centos-release-ceph-hammer',
logoutput => 'on_failure', logoutput => 'on_failure',

View File

@ -0,0 +1,3 @@
---
prelude: >
This is the first release that will support Ceph Jewel deployments.

View File

@ -21,7 +21,12 @@ require 'spec_helper_acceptance'
describe 'ceph rgw/civetweb' do describe 'ceph rgw/civetweb' do
release = 'hammer' if os[:family].casecmp('RedHat') == 0
release = 'hammer'
else
release = 'jewel'
end
fsid = 'a4807c9a-e76f-4666-a297-6d6cbc922e3a' fsid = 'a4807c9a-e76f-4666-a297-6d6cbc922e3a'
mon_key ='AQCztJdSyNb0NBAASA2yPZPuwXeIQnDJ9O8gVw==' mon_key ='AQCztJdSyNb0NBAASA2yPZPuwXeIQnDJ9O8gVw=='
admin_key = 'AQA0TVRTsP/aHxAAFBvntu1dSEJHxtJeFFrRsg==' admin_key = 'AQA0TVRTsP/aHxAAFBvntu1dSEJHxtJeFFrRsg=='

View File

@ -19,7 +19,12 @@ require 'spec_helper_acceptance'
describe 'ceph rgw' do describe 'ceph rgw' do
release = 'hammer' if os[:family].casecmp('RedHat') == 0
release = 'hammer'
else
release = 'jewel'
end
fsid = 'a4807c9a-e76f-4666-a297-6d6cbc922e3a' fsid = 'a4807c9a-e76f-4666-a297-6d6cbc922e3a'
mon_key ='AQCztJdSyNb0NBAASA2yPZPuwXeIQnDJ9O8gVw==' mon_key ='AQCztJdSyNb0NBAASA2yPZPuwXeIQnDJ9O8gVw=='
admin_key = 'AQA0TVRTsP/aHxAAFBvntu1dSEJHxtJeFFrRsg==' admin_key = 'AQA0TVRTsP/aHxAAFBvntu1dSEJHxtJeFFrRsg=='

View File

@ -22,11 +22,19 @@ describe 'ceph usecases' do
# passing it directly as unqoted array is not supported everywhere # passing it directly as unqoted array is not supported everywhere
packages = "[ 'python-ceph', 'ceph-common', 'librados2', 'librbd1', 'libcephfs1' ]" 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 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 it 'should install one monitor and one OSD on /srv/data' do
pp = <<-EOS pp = <<-EOS
class { 'ceph::repo': } class { 'ceph::repo':
release => #{release},
}
class { 'ceph': class { 'ceph':
fsid => '82274746-9a2c-426b-8c51-107fb0d890c6', fsid => '82274746-9a2c-426b-8c51-107fb0d890c6',
mon_host => $::ipaddress, mon_host => $::ipaddress,
@ -35,7 +43,9 @@ describe 'ceph usecases' do
osd_pool_default_min_size => '1', osd_pool_default_min_size => '1',
} }
ceph_config { ceph_config {
'global/osd_journal_size': value => '100'; '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': ceph::mon { 'a':
public_addr => $::ipaddress, public_addr => $::ipaddress,
@ -100,8 +110,8 @@ describe 'ceph usecases' do
end end
end end
if osfamily == 'RedHat' if osfamily == 'RedHat'
shell 'service ceph status mon.a', { :acceptable_exit_codes => [1] } do |r| shell 'systemctl status ceph-mon@a', { :acceptable_exit_codes => [1] } do |r|
expect(r.stdout).to match(/mon.a not found/) expect(r.stdout).to match(/Active: inactive/)
expect(r.stderr).to be_empty expect(r.stderr).to be_empty
end end
end end

View File

@ -39,7 +39,7 @@ describe 'ceph::repo' do
) } ) }
it { is_expected.to contain_apt__source('ceph').with( 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', :release => 'jessie',
:require => 'Apt::Key[ceph]' :require => 'Apt::Key[ceph]'
) } ) }
@ -81,7 +81,7 @@ describe 'ceph::repo' do
) } ) }
it { is_expected.to contain_apt__source('ceph').with( 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', :release => 'trusty',
:require => 'Apt::Key[ceph]' :require => 'Apt::Key[ceph]'
) } ) }
@ -115,7 +115,7 @@ describe 'ceph::repo' do
) } ) }
it { is_expected.to contain_apt__source('ceph').with( 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', :release => 'trusty',
:require => 'Apt::Key[ceph]' :require => 'Apt::Key[ceph]'
) } ) }
@ -139,7 +139,7 @@ describe 'ceph::repo' do
it { is_expected.to contain_apt__source('ceph').with( it { is_expected.to contain_apt__source('ceph').with(
:ensure => 'absent', :ensure => 'absent',
:location => 'http://download.ceph.com/debian-hammer/', :location => 'http://download.ceph.com/debian-jewel/',
:release => 'trusty', :release => 'trusty',
:require => 'Apt::Key[ceph]' :require => 'Apt::Key[ceph]'
) } ) }
@ -183,9 +183,9 @@ describe 'ceph::repo' do
it { is_expected.to contain_yumrepo('ext-ceph').with( it { is_expected.to contain_yumrepo('ext-ceph').with(
:enabled => '1', :enabled => '1',
:descr => 'External Ceph hammer', :descr => 'External Ceph jewel',
:name => 'ext-ceph-hammer', :name => 'ext-ceph-jewel',
:baseurl => 'http://download.ceph.com/rpm-hammer/el7/$basearch', :baseurl => 'http://download.ceph.com/rpm-jewel/el7/$basearch',
:gpgcheck => '1', :gpgcheck => '1',
:gpgkey => 'https://download.ceph.com/keys/release.asc', :gpgkey => 'https://download.ceph.com/keys/release.asc',
:mirrorlist => 'absent', :mirrorlist => 'absent',
@ -195,8 +195,8 @@ describe 'ceph::repo' do
it { is_expected.to contain_yumrepo('ext-ceph-noarch').with( it { is_expected.to contain_yumrepo('ext-ceph-noarch').with(
:enabled => '1', :enabled => '1',
:descr => 'External Ceph noarch', :descr => 'External Ceph noarch',
:name => 'ext-ceph-hammer-noarch', :name => 'ext-ceph-jewel-noarch',
:baseurl => 'http://download.ceph.com/rpm-hammer/el7/noarch', :baseurl => 'http://download.ceph.com/rpm-jewel/el7/noarch',
:gpgcheck => '1', :gpgcheck => '1',
:gpgkey => 'https://download.ceph.com/keys/release.asc', :gpgkey => 'https://download.ceph.com/keys/release.asc',
:mirrorlist => 'absent', :mirrorlist => 'absent',
@ -286,9 +286,9 @@ describe 'ceph::repo' do
it { is_expected.to contain_yumrepo('ext-ceph').with( it { is_expected.to contain_yumrepo('ext-ceph').with(
:enabled => '1', :enabled => '1',
:descr => 'External Ceph hammer', :descr => 'External Ceph jewel',
:name => 'ext-ceph-hammer', :name => 'ext-ceph-jewel',
:baseurl => 'http://download.ceph.com/rpm-hammer/el7/$basearch', :baseurl => 'http://download.ceph.com/rpm-jewel/el7/$basearch',
:gpgcheck => '1', :gpgcheck => '1',
:gpgkey => 'https://download.ceph.com/keys/release.asc', :gpgkey => 'https://download.ceph.com/keys/release.asc',
:mirrorlist => 'absent', :mirrorlist => 'absent',
@ -301,8 +301,8 @@ describe 'ceph::repo' do
it { is_expected.to contain_yumrepo('ext-ceph-noarch').with( it { is_expected.to contain_yumrepo('ext-ceph-noarch').with(
:enabled => '1', :enabled => '1',
:descr => 'External Ceph noarch', :descr => 'External Ceph noarch',
:name => 'ext-ceph-hammer-noarch', :name => 'ext-ceph-jewel-noarch',
:baseurl => 'http://download.ceph.com/rpm-hammer/el7/noarch', :baseurl => 'http://download.ceph.com/rpm-jewel/el7/noarch',
:gpgcheck => '1', :gpgcheck => '1',
:gpgkey => 'https://download.ceph.com/keys/release.asc', :gpgkey => 'https://download.ceph.com/keys/release.asc',
:mirrorlist => 'absent', :mirrorlist => 'absent',
@ -337,9 +337,9 @@ describe 'ceph::repo' do
it { is_expected.to contain_yumrepo('ext-ceph').with( it { is_expected.to contain_yumrepo('ext-ceph').with(
:enabled => '0', :enabled => '0',
:descr => 'External Ceph hammer', :descr => 'External Ceph jewel',
:name => 'ext-ceph-hammer', :name => 'ext-ceph-jewel',
:baseurl => 'http://download.ceph.com/rpm-hammer/el7/$basearch', :baseurl => 'http://download.ceph.com/rpm-jewel/el7/$basearch',
:gpgcheck => '1', :gpgcheck => '1',
:gpgkey => 'https://download.ceph.com/keys/release.asc', :gpgkey => 'https://download.ceph.com/keys/release.asc',
:mirrorlist => 'absent', :mirrorlist => 'absent',
@ -349,8 +349,8 @@ describe 'ceph::repo' do
it { is_expected.to contain_yumrepo('ext-ceph-noarch').with( it { is_expected.to contain_yumrepo('ext-ceph-noarch').with(
:enabled => '0', :enabled => '0',
:descr => 'External Ceph noarch', :descr => 'External Ceph noarch',
:name => 'ext-ceph-hammer-noarch', :name => 'ext-ceph-jewel-noarch',
:baseurl => 'http://download.ceph.com/rpm-hammer/el7/noarch', :baseurl => 'http://download.ceph.com/rpm-jewel/el7/noarch',
:gpgcheck => '1', :gpgcheck => '1',
:gpgkey => 'https://download.ceph.com/keys/release.asc', :gpgkey => 'https://download.ceph.com/keys/release.asc',
:mirrorlist => 'absent', :mirrorlist => 'absent',
@ -393,9 +393,9 @@ describe 'ceph::repo' do
it { is_expected.to contain_yumrepo('ext-ceph').with( it { is_expected.to contain_yumrepo('ext-ceph').with(
:enabled => '1', :enabled => '1',
:descr => 'External Ceph hammer', :descr => 'External Ceph jewel',
:name => 'ext-ceph-hammer', :name => 'ext-ceph-jewel',
:baseurl => 'http://download.ceph.com/rpm-hammer/el7/$basearch', :baseurl => 'http://download.ceph.com/rpm-jewel/el7/$basearch',
:gpgcheck => '1', :gpgcheck => '1',
:gpgkey => 'https://download.ceph.com/keys/release.asc', :gpgkey => 'https://download.ceph.com/keys/release.asc',
:mirrorlist => 'absent', :mirrorlist => 'absent',
@ -405,8 +405,8 @@ describe 'ceph::repo' do
it { is_expected.to contain_yumrepo('ext-ceph-noarch').with( it { is_expected.to contain_yumrepo('ext-ceph-noarch').with(
:enabled => '1', :enabled => '1',
:descr => 'External Ceph noarch', :descr => 'External Ceph noarch',
:name => 'ext-ceph-hammer-noarch', :name => 'ext-ceph-jewel-noarch',
:baseurl => 'http://download.ceph.com/rpm-hammer/el7/noarch', :baseurl => 'http://download.ceph.com/rpm-jewel/el7/noarch',
:gpgcheck => '1', :gpgcheck => '1',
:gpgkey => 'https://download.ceph.com/keys/release.asc', :gpgkey => 'https://download.ceph.com/keys/release.asc',
:mirrorlist => 'absent', :mirrorlist => 'absent',
@ -455,9 +455,9 @@ describe 'ceph::repo' do
it { is_expected.to contain_yumrepo('ext-ceph').with( it { is_expected.to contain_yumrepo('ext-ceph').with(
:enabled => '1', :enabled => '1',
:descr => 'External Ceph hammer', :descr => 'External Ceph jewel',
:name => 'ext-ceph-hammer', :name => 'ext-ceph-jewel',
:baseurl => 'http://download.ceph.com/rpm-hammer/el7/$basearch', :baseurl => 'http://download.ceph.com/rpm-jewel/el7/$basearch',
:gpgcheck => '1', :gpgcheck => '1',
:gpgkey => 'https://download.ceph.com/keys/release.asc', :gpgkey => 'https://download.ceph.com/keys/release.asc',
:mirrorlist => 'absent', :mirrorlist => 'absent',
@ -467,8 +467,8 @@ describe 'ceph::repo' do
it { is_expected.to contain_yumrepo('ext-ceph-noarch').with( it { is_expected.to contain_yumrepo('ext-ceph-noarch').with(
:enabled => '1', :enabled => '1',
:descr => 'External Ceph noarch', :descr => 'External Ceph noarch',
:name => 'ext-ceph-hammer-noarch', :name => 'ext-ceph-jewel-noarch',
:baseurl => 'http://download.ceph.com/rpm-hammer/el7/noarch', :baseurl => 'http://download.ceph.com/rpm-jewel/el7/noarch',
:gpgcheck => '1', :gpgcheck => '1',
:gpgkey => 'https://download.ceph.com/keys/release.asc', :gpgkey => 'https://download.ceph.com/keys/release.asc',
:mirrorlist => 'absent', :mirrorlist => 'absent',
@ -569,9 +569,9 @@ describe 'ceph::repo' do
it { is_expected.to contain_yumrepo('ext-ceph').with( it { is_expected.to contain_yumrepo('ext-ceph').with(
:enabled => '0', :enabled => '0',
:descr => 'External Ceph hammer', :descr => 'External Ceph jewel',
:name => 'ext-ceph-hammer', :name => 'ext-ceph-jewel',
:baseurl => 'http://download.ceph.com/rpm-hammer/el7/$basearch', :baseurl => 'http://download.ceph.com/rpm-jewel/el7/$basearch',
:gpgcheck => '1', :gpgcheck => '1',
:gpgkey => 'https://download.ceph.com/keys/release.asc', :gpgkey => 'https://download.ceph.com/keys/release.asc',
:mirrorlist => 'absent', :mirrorlist => 'absent',
@ -581,8 +581,8 @@ describe 'ceph::repo' do
it { is_expected.to contain_yumrepo('ext-ceph-noarch').with( it { is_expected.to contain_yumrepo('ext-ceph-noarch').with(
:enabled => '0', :enabled => '0',
:descr => 'External Ceph noarch', :descr => 'External Ceph noarch',
:name => 'ext-ceph-hammer-noarch', :name => 'ext-ceph-jewel-noarch',
:baseurl => 'http://download.ceph.com/rpm-hammer/el7/noarch', :baseurl => 'http://download.ceph.com/rpm-jewel/el7/noarch',
:gpgcheck => '1', :gpgcheck => '1',
:gpgkey => 'https://download.ceph.com/keys/release.asc', :gpgkey => 'https://download.ceph.com/keys/release.asc',
:mirrorlist => 'absent', :mirrorlist => 'absent',
@ -625,9 +625,9 @@ describe 'ceph::repo' do
it { is_expected.to contain_yumrepo('ext-ceph').with( it { is_expected.to contain_yumrepo('ext-ceph').with(
:enabled => '1', :enabled => '1',
:descr => 'External Ceph hammer', :descr => 'External Ceph jewel',
:name => 'ext-ceph-hammer', :name => 'ext-ceph-jewel',
:baseurl => 'http://download.ceph.com/rpm-hammer/el7/$basearch', :baseurl => 'http://download.ceph.com/rpm-jewel/el7/$basearch',
:gpgcheck => '1', :gpgcheck => '1',
:gpgkey => 'https://download.ceph.com/keys/release.asc', :gpgkey => 'https://download.ceph.com/keys/release.asc',
:mirrorlist => 'absent', :mirrorlist => 'absent',
@ -637,8 +637,8 @@ describe 'ceph::repo' do
it { is_expected.to contain_yumrepo('ext-ceph-noarch').with( it { is_expected.to contain_yumrepo('ext-ceph-noarch').with(
:enabled => '1', :enabled => '1',
:descr => 'External Ceph noarch', :descr => 'External Ceph noarch',
:name => 'ext-ceph-hammer-noarch', :name => 'ext-ceph-jewel-noarch',
:baseurl => 'http://download.ceph.com/rpm-hammer/el7/noarch', :baseurl => 'http://download.ceph.com/rpm-jewel/el7/noarch',
:gpgcheck => '1', :gpgcheck => '1',
:gpgkey => 'https://download.ceph.com/keys/release.asc', :gpgkey => 'https://download.ceph.com/keys/release.asc',
:mirrorlist => 'absent', :mirrorlist => 'absent',

View File

@ -85,15 +85,29 @@ touch /etc/ceph/ceph.client.admin.keyring'
set -ex set -ex
mon_data=\$(ceph-mon --id A --show-config-value mon_data) mon_data=\$(ceph-mon --id A --show-config-value mon_data)
if [ ! -d \$mon_data ] ; then if [ ! -d \$mon_data ] ; then
mkdir -p \$mon_data mkdir -p \$mon_data
if ceph-mon \ if getent passwd ceph >/dev/null 2>&1; then
--mkfs \ chown -h ceph:ceph \$mon_data
--id A \ if ceph-mon \
--keyring /tmp/ceph-mon-keyring-A ; then --setuser ceph --setgroup ceph \
touch \$mon_data/done \$mon_data/upstart \$mon_data/keyring --mkfs \
else --id A \
rm -fr \$mon_data --keyring /tmp/ceph-mon-keyring-A ; then
fi 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 \
--keyring /tmp/ceph-mon-keyring-A ; then
touch \$mon_data/done \$mon_data/upstart \$mon_data/keyring
else
rm -fr \$mon_data
fi
fi
fi fi
", ",
'logoutput' => true) } 'logoutput' => true) }
@ -123,15 +137,29 @@ touch /etc/ceph/ceph.client.admin.keyring'
set -ex set -ex
mon_data=\$(ceph-mon --id A --show-config-value mon_data) mon_data=\$(ceph-mon --id A --show-config-value mon_data)
if [ ! -d \$mon_data ] ; then if [ ! -d \$mon_data ] ; then
mkdir -p \$mon_data mkdir -p \$mon_data
if ceph-mon \ if getent passwd ceph >/dev/null 2>&1; then
--mkfs \ chown -h ceph:ceph \$mon_data
--id A \ if ceph-mon \
--keyring /etc/ceph/ceph.mon.keyring ; then --setuser ceph --setgroup ceph \
touch \$mon_data/done \$mon_data/upstart \$mon_data/keyring --mkfs \
else --id A \
rm -fr \$mon_data --keyring /etc/ceph/ceph.mon.keyring ; then
fi 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 \
--keyring /etc/ceph/ceph.mon.keyring ; then
touch \$mon_data/done \$mon_data/upstart \$mon_data/keyring
else
rm -fr \$mon_data
fi
fi
fi fi
", ",
'logoutput' => true) } 'logoutput' => true) }
@ -163,15 +191,29 @@ touch /etc/ceph/testcluster.client.admin.keyring'
set -ex set -ex
mon_data=\$(ceph-mon --cluster testcluster --id A --show-config-value mon_data) mon_data=\$(ceph-mon --cluster testcluster --id A --show-config-value mon_data)
if [ ! -d \$mon_data ] ; then if [ ! -d \$mon_data ] ; then
mkdir -p \$mon_data mkdir -p \$mon_data
if ceph-mon --cluster testcluster \ if getent passwd ceph >/dev/null 2>&1; then
--mkfs \ chown -h ceph:ceph \$mon_data
--id A \ if ceph-mon --cluster testcluster \
--keyring /dev/null ; then --setuser ceph --setgroup ceph \
touch \$mon_data/done \$mon_data/upstart \$mon_data/keyring --mkfs \
else --id A \
rm -fr \$mon_data --keyring /dev/null ; then
fi 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 \
--keyring /dev/null ; then
touch \$mon_data/done \$mon_data/upstart \$mon_data/keyring
else
rm -fr \$mon_data
fi
fi
fi fi
", ",
'logoutput' => true) } 'logoutput' => true) }
@ -272,15 +314,29 @@ touch /etc/ceph/ceph.client.admin.keyring'
set -ex set -ex
mon_data=\$(ceph-mon --id A --show-config-value mon_data) mon_data=\$(ceph-mon --id A --show-config-value mon_data)
if [ ! -d \$mon_data ] ; then if [ ! -d \$mon_data ] ; then
mkdir -p \$mon_data mkdir -p \$mon_data
if ceph-mon \ if getent passwd ceph >/dev/null 2>&1; then
--mkfs \ chown -h ceph:ceph \$mon_data
--id A \ if ceph-mon \
--keyring /tmp/ceph-mon-keyring-A ; then --setuser ceph --setgroup ceph \
touch \$mon_data/done \$mon_data/sysvinit \$mon_data/keyring --mkfs \
else --id A \
rm -fr \$mon_data --keyring /tmp/ceph-mon-keyring-A ; then
fi 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/systemd \$mon_data/keyring
else
rm -fr \$mon_data
fi
fi
fi fi
", ",
'logoutput' => true) } 'logoutput' => true) }
@ -310,15 +366,29 @@ touch /etc/ceph/ceph.client.admin.keyring'
set -ex set -ex
mon_data=\$(ceph-mon --id A --show-config-value mon_data) mon_data=\$(ceph-mon --id A --show-config-value mon_data)
if [ ! -d \$mon_data ] ; then if [ ! -d \$mon_data ] ; then
mkdir -p \$mon_data mkdir -p \$mon_data
if ceph-mon \ if getent passwd ceph >/dev/null 2>&1; then
--mkfs \ chown -h ceph:ceph \$mon_data
--id A \ if ceph-mon \
--keyring /etc/ceph/ceph.mon.keyring ; then --setuser ceph --setgroup ceph \
touch \$mon_data/done \$mon_data/sysvinit \$mon_data/keyring --mkfs \
else --id A \
rm -fr \$mon_data --keyring /etc/ceph/ceph.mon.keyring ; then
fi 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/systemd \$mon_data/keyring
else
rm -fr \$mon_data
fi
fi
fi fi
", ",
'logoutput' => true) } 'logoutput' => true) }
@ -350,15 +420,29 @@ touch /etc/ceph/testcluster.client.admin.keyring'
set -ex set -ex
mon_data=\$(ceph-mon --cluster testcluster --id A --show-config-value mon_data) mon_data=\$(ceph-mon --cluster testcluster --id A --show-config-value mon_data)
if [ ! -d \$mon_data ] ; then if [ ! -d \$mon_data ] ; then
mkdir -p \$mon_data mkdir -p \$mon_data
if ceph-mon --cluster testcluster \ if getent passwd ceph >/dev/null 2>&1; then
--mkfs \ chown -h ceph:ceph \$mon_data
--id A \ if ceph-mon --cluster testcluster \
--keyring /dev/null ; then --setuser ceph --setgroup ceph \
touch \$mon_data/done \$mon_data/sysvinit \$mon_data/keyring --mkfs \
else --id A \
rm -fr \$mon_data --keyring /dev/null ; then
fi 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/systemd \$mon_data/keyring
else
rm -fr \$mon_data
fi
fi
fi fi
", ",
'logoutput' => true) } 'logoutput' => true) }
@ -460,15 +544,29 @@ test -e /etc/ceph/ceph.client.admin.keyring'
set -ex set -ex
mon_data=\$(ceph-mon --id A --show-config-value mon_data) mon_data=\$(ceph-mon --id A --show-config-value mon_data)
if [ ! -d \$mon_data ] ; then if [ ! -d \$mon_data ] ; then
mkdir -p \$mon_data mkdir -p \$mon_data
if ceph-mon \ if getent passwd ceph >/dev/null 2>&1; then
--mkfs \ chown -h ceph:ceph \$mon_data
--id A \ if ceph-mon \
--keyring /tmp/ceph-mon-keyring-A ; then --setuser ceph --setgroup ceph \
touch \$mon_data/done \$mon_data/sysvinit \$mon_data/keyring --mkfs \
else --id A \
rm -fr \$mon_data --keyring /tmp/ceph-mon-keyring-A ; then
fi 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 \
--keyring /tmp/ceph-mon-keyring-A ; then
touch \$mon_data/done \$mon_data/sysvinit \$mon_data/keyring
else
rm -fr \$mon_data
fi
fi
fi fi
", ",
'logoutput' => true) } 'logoutput' => true) }
@ -503,15 +601,29 @@ touch /etc/ceph/ceph.client.admin.keyring'
set -ex set -ex
mon_data=\$(ceph-mon --id A --show-config-value mon_data) mon_data=\$(ceph-mon --id A --show-config-value mon_data)
if [ ! -d \$mon_data ] ; then if [ ! -d \$mon_data ] ; then
mkdir -p \$mon_data mkdir -p \$mon_data
if ceph-mon \ if getent passwd ceph >/dev/null 2>&1; then
--mkfs \ chown -h ceph:ceph \$mon_data
--id A \ if ceph-mon \
--keyring /etc/ceph/ceph.mon.keyring ; then --setuser ceph --setgroup ceph \
touch \$mon_data/done \$mon_data/sysvinit \$mon_data/keyring --mkfs \
else --id A \
rm -fr \$mon_data --keyring /etc/ceph/ceph.mon.keyring ; then
fi 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 \
--keyring /etc/ceph/ceph.mon.keyring ; then
touch \$mon_data/done \$mon_data/sysvinit \$mon_data/keyring
else
rm -fr \$mon_data
fi
fi
fi fi
", ",
'logoutput' => true) } 'logoutput' => true) }
@ -543,15 +655,29 @@ touch /etc/ceph/testcluster.client.admin.keyring'
set -ex set -ex
mon_data=\$(ceph-mon --cluster testcluster --id A --show-config-value mon_data) mon_data=\$(ceph-mon --cluster testcluster --id A --show-config-value mon_data)
if [ ! -d \$mon_data ] ; then if [ ! -d \$mon_data ] ; then
mkdir -p \$mon_data mkdir -p \$mon_data
if ceph-mon --cluster testcluster \ if getent passwd ceph >/dev/null 2>&1; then
--mkfs \ chown -h ceph:ceph \$mon_data
--id A \ if ceph-mon --cluster testcluster \
--keyring /dev/null ; then --setuser ceph --setgroup ceph \
touch \$mon_data/done \$mon_data/sysvinit \$mon_data/keyring --mkfs \
else --id A \
rm -fr \$mon_data --keyring /dev/null ; then
fi 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 \
--keyring /dev/null ; then
touch \$mon_data/done \$mon_data/sysvinit \$mon_data/keyring
else
rm -fr \$mon_data
fi
fi
fi fi
", ",
'logoutput' => true) } 'logoutput' => true) }

View File

@ -46,7 +46,10 @@ test -f /usr/lib/udev/rules.d/95-ceph-osd.rules && test \$DISABLE_UDEV -eq 1
'command' => "/bin/true # comment to satisfy puppet syntax requirements 'command' => "/bin/true # comment to satisfy puppet syntax requirements
set -ex set -ex
if ! test -b /srv ; then if ! test -b /srv ; then
mkdir -p /srv mkdir -p /srv
if getent passwd ceph >/dev/null 2>&1; then
chown -h ceph:ceph /srv
fi
fi fi
ceph-disk prepare /srv ceph-disk prepare /srv
udevadm settle udevadm settle
@ -62,7 +65,10 @@ ceph-disk list | grep -E ' */srv1? .*ceph data, (prepared|active)' ||
'command' => "/bin/true # comment to satisfy puppet syntax requirements 'command' => "/bin/true # comment to satisfy puppet syntax requirements
set -ex set -ex
if ! test -b /srv ; then if ! test -b /srv ; then
mkdir -p /srv mkdir -p /srv
if getent passwd ceph >/dev/null 2>&1; then
chown -h ceph:ceph /srv
fi
fi fi
# activate happens via udev when using the entire device # activate happens via udev when using the entire device
if ! test -b /srv || ! test -b /srv1 ; then if ! test -b /srv || ! test -b /srv1 ; then
@ -110,7 +116,10 @@ test -f /usr/lib/udev/rules.d/95-ceph-osd.rules && test \$DISABLE_UDEV -eq 1
'command' => "/bin/true # comment to satisfy puppet syntax requirements 'command' => "/bin/true # comment to satisfy puppet syntax requirements
set -ex set -ex
if ! test -b /srv/data ; then if ! test -b /srv/data ; then
mkdir -p /srv/data mkdir -p /srv/data
if getent passwd ceph >/dev/null 2>&1; then
chown -h ceph:ceph /srv/data
fi
fi fi
ceph-disk prepare --cluster testcluster /srv/data /srv/journal ceph-disk prepare --cluster testcluster /srv/data /srv/journal
udevadm settle udevadm settle
@ -126,7 +135,10 @@ ceph-disk list | grep -E ' */srv/data1? .*ceph data, (prepared|active)' ||
'command' => "/bin/true # comment to satisfy puppet syntax requirements 'command' => "/bin/true # comment to satisfy puppet syntax requirements
set -ex set -ex
if ! test -b /srv/data ; then if ! test -b /srv/data ; then
mkdir -p /srv/data mkdir -p /srv/data
if getent passwd ceph >/dev/null 2>&1; then
chown -h ceph:ceph /srv/data
fi
fi fi
# activate happens via udev when using the entire device # activate happens via udev when using the entire device
if ! test -b /srv/data || ! test -b /srv/data1 ; then if ! test -b /srv/data || ! test -b /srv/data1 ; then
@ -168,6 +180,7 @@ fi
if [ \"\$id\" ] ; then if [ \"\$id\" ] ; then
stop ceph-osd cluster=ceph id=\$id || true stop ceph-osd cluster=ceph id=\$id || true
service ceph stop osd.\$id || true service ceph stop osd.\$id || true
systemctl stop ceph-osd@$id || true
ceph osd crush remove osd.\$id ceph osd crush remove osd.\$id
ceph auth del osd.\$id ceph auth del osd.\$id
ceph osd rm \$id ceph osd rm \$id

View File

@ -1,6 +1,6 @@
--- ---
######## Ceph ######## Ceph
ceph::profile::params::release: 'hammer' ceph::profile::params::release: 'jewel'
######## Ceph.conf ######## Ceph.conf
ceph::profile::params::fsid: '4b5c8c0a-ff60-454b-a1b4-9747aa737d19' ceph::profile::params::fsid: '4b5c8c0a-ff60-454b-a1b4-9747aa737d19'