1 From ff98c42f0e6ce22969e986933d0a60d73a281a1d Mon Sep 17 00:00:00 2001
2 From: Don Penney <don.penney@windriver.com>
3 Date: Tue, 10 Jan 2017 13:31:17 -0500
4 Subject: [PATCH 1/5] Roll up TIS patches
7 manifests/mon.pp | 14 +++++++++++---
8 manifests/osd.pp | 38 +++++++++++++++++++-------------------
9 manifests/rgw.pp | 7 +++++++
10 3 files changed, 37 insertions(+), 22 deletions(-)
12 diff --git a/manifests/mon.pp b/manifests/mon.pp
13 index bc0298c..fa99df5 100644
14 --- a/manifests/mon.pp
15 +++ b/manifests/mon.pp
16 @@ -65,6 +65,8 @@ define ceph::mon (
17 $authentication_type = 'cephx',
21 + $service_ensure = 'running',
22 $exec_timeout = $::ceph::params::exec_timeout,
25 @@ -154,6 +156,10 @@ test -e \$mon_data/done
30 + $fsid_option = "--fsid ${fsid}"
34 # prevent automatic creation of the client.admin key by ceph-create-keys
35 -> exec { "ceph-mon-${cluster_name}.client.admin.keyring-${id}":
36 @@ -176,7 +182,8 @@ if [ ! -d \$mon_data ] ; then
37 --setuser ceph --setgroup ceph \
40 - --keyring ${keyring_path} ; then
41 + --keyring ${keyring_path} \
42 + ${fsid_option} ; then
43 touch \$mon_data/done \$mon_data/${init} \$mon_data/keyring
44 chown -h ceph:ceph \$mon_data/done \$mon_data/${init} \$mon_data/keyring
46 @@ -186,7 +193,8 @@ if [ ! -d \$mon_data ] ; then
47 if ceph-mon ${cluster_option} \
50 - --keyring ${keyring_path} ; then
51 + --keyring ${keyring_path} \
52 + ${fsid_option} ; then
53 touch \$mon_data/done \$mon_data/${init} \$mon_data/keyring
56 @@ -203,7 +211,7 @@ test -d \$mon_data
57 timeout => $exec_timeout,
59 -> service { $mon_service:
61 + ensure => $service_ensure,
64 # if the service is running before we setup the configs, notify service
65 diff --git a/manifests/osd.pp b/manifests/osd.pp
66 index d24b95e..9b8cd99 100644
67 --- a/manifests/osd.pp
68 +++ b/manifests/osd.pp
69 @@ -52,6 +52,8 @@ define ceph::osd (
73 + $cluster_uuid = undef,
75 $exec_timeout = $::ceph::params::exec_timeout,
76 $selinux_file_context = 'ceph_var_lib_t',
77 $fsid = $::ceph::profile::params::fsid,
78 @@ -68,6 +70,14 @@ define ceph::osd (
80 $cluster_option = "--cluster ${cluster_name}"
83 + $cluster_uuid_option = "--cluster-uuid ${cluster_uuid}"
87 + $uuid_option = "--osd-uuid ${uuid}"
90 if $ensure == present {
92 $ceph_check_udev = "ceph-osd-check-udev-${name}"
93 @@ -120,25 +130,15 @@ test -z $(ceph-disk list $(readlink -f ${data}) | egrep -o '[0-9a-f]{8}-([0-9a-f
94 Exec[$ceph_check_udev] -> Exec[$ceph_prepare]
95 # ceph-disk: prepare should be idempotent http://tracker.ceph.com/issues/7475
97 - command => "/bin/true # comment to satisfy puppet syntax requirements
99 -disk=$(readlink -f ${data})
100 -if ! test -b \$disk ; then
101 - echo \$disk | egrep -e '^/dev' -q -v
103 - if getent passwd ceph >/dev/null 2>&1; then
104 - chown -h ceph:ceph \$disk
107 -ceph-disk prepare ${cluster_option} ${fsid_option} $(readlink -f ${data}) $(readlink -f ${journal})
110 - unless => "/bin/true # comment to satisfy puppet syntax requirements
112 -disk=$(readlink -f ${data})
113 -ceph-disk list | egrep \" *(\${disk}1?|\${disk}p1?) .*ceph data, (prepared|active)\" ||
114 -{ test -f \$disk/fsid && test -f \$disk/ceph_fsid && test -f \$disk/magic ;}
117 + command => "/usr/sbin/ceph-disk prepare ${cluster_option} ${cluster_uuid_option} ${uuid_option} --fs-type xfs --zap-disk ${data} ${journal}",
118 + # We don't want to erase the disk if:
119 + # 1. There is already ceph data on the disk for our cluster AND
120 + # 2. The uuid for the OSD we are configuring matches the uuid for the
121 + # OSD on the disk. We don't want to attempt to re-use an OSD that
122 + # had previously been deleted.
123 + unless => "/usr/sbin/ceph-disk list | grep -v 'unknown cluster' | grep ' *${data}.*ceph data' | grep 'osd uuid ${uuid}'",
126 timeout => $exec_timeout,
128 diff --git a/manifests/rgw.pp b/manifests/rgw.pp
129 index 2612785..ebc83ce 100644
130 --- a/manifests/rgw.pp
131 +++ b/manifests/rgw.pp
132 @@ -185,6 +185,13 @@ define ceph::rgw (
133 provider => $::ceph::params::service_provider,
135 # Everything else that is supported by puppet-ceph should run systemd.
136 + } elsif $::service_provider == 'systemd' {
138 + name => "radosgw-${name}",
139 + start => "systemctl start ceph-radosgw",
140 + stop => "systemctl stop ceph-radosgw",
141 + status => "systemctl status ceph-radosgw",
145 name => "ceph-radosgw@${name}",