From d0ddf30a4cf3528f758131f2e259c4a3a401d4a6 Mon Sep 17 00:00:00 2001 From: Charles Short Date: Fri, 24 Sep 2021 09:21:35 -0400 Subject: [PATCH] Add debian support for puppet-ceph Add debian infrastructure to build puppet-ceph as a debian packaging. Patches Dropped: 0005-Remove-puppetlabs-apt-as-ceph-requirement.patch 0004-US92424-Add-OSD-support-for-persistent-naming.patch 0006-ceph-disk-prepare-invalid-data-disk-value.patch 0008-ceph-mimic-prepare-activate-os.patch 0009-fix-ceph-osd-disk-partition-for-nvme-disks.patch Re-diffed: 0001-Roll-up-TIS-patches.patch 0002-Newton-rebase-fixes.patch 0003-ceph-jewel-rebase.patch 0004-US92424-Add-OSD-support-for-persistent-naming.patch 0005-Add-StarlingX-specific-restart-command-for-Ceph-moni.patch The patches that were dropped needs to be re-worked for ceph-volume, since ceph-disk has been deprecated and not included in the Ceph version from Debian. 0001-Roll-up-TIS-patches.patch and 0003-ceph-jewel-rebase.patch were rebased because most of the systemd logic has been dropped as well and need to be redone. Story: 2009101 Task: 43431 Signed-off-by: Charles Short Change-Id: I5a66bcd274f2752d4c050fab25a7b1b8347b650e --- .../puppet-ceph-3.1.1/debian/meta_data.yaml | 10 ++ .../patches/0001-Roll-up-TIS-patches.patch | 92 +++++++++++++++++++ .../patches/0002-Newton-rebase-fixes.patch | 47 ++++++++++ .../patches/0003-ceph-jewel-rebase.patch | 24 +++++ ...dd-OSD-support-for-persistent-naming.patch | 29 ++++++ ...ecific-restart-command-for-Ceph-moni.patch | 35 +++++++ .../puppet-ceph-3.1.1/debian/patches/series | 5 + 7 files changed, 242 insertions(+) create mode 100644 config/puppet-modules/openstack/puppet-ceph-3.1.1/debian/meta_data.yaml create mode 100644 config/puppet-modules/openstack/puppet-ceph-3.1.1/debian/patches/0001-Roll-up-TIS-patches.patch create mode 100644 config/puppet-modules/openstack/puppet-ceph-3.1.1/debian/patches/0002-Newton-rebase-fixes.patch create mode 100644 config/puppet-modules/openstack/puppet-ceph-3.1.1/debian/patches/0003-ceph-jewel-rebase.patch create mode 100644 config/puppet-modules/openstack/puppet-ceph-3.1.1/debian/patches/0004-US92424-Add-OSD-support-for-persistent-naming.patch create mode 100644 config/puppet-modules/openstack/puppet-ceph-3.1.1/debian/patches/0005-Add-StarlingX-specific-restart-command-for-Ceph-moni.patch create mode 100644 config/puppet-modules/openstack/puppet-ceph-3.1.1/debian/patches/series diff --git a/config/puppet-modules/openstack/puppet-ceph-3.1.1/debian/meta_data.yaml b/config/puppet-modules/openstack/puppet-ceph-3.1.1/debian/meta_data.yaml new file mode 100644 index 000000000..9127d2ed4 --- /dev/null +++ b/config/puppet-modules/openstack/puppet-ceph-3.1.1/debian/meta_data.yaml @@ -0,0 +1,10 @@ +--- +debver: 3.1.1-1 +debname: puppet-module-ceph +dl_path: + name: puppet-module-ceph-debian-3.1.1-1.tar.gz + url: https://salsa.debian.org/openstack-team/puppet/puppet-module-ceph/-/archive/debian/3.1.1-1/puppet-module-ceph-debian-3.1.1-1.tar.gz + md5sum: abbb478a9dd85ba8b628296668459dec +revision: + dist: $STX_DIST + PKG_GITREVCOUNT: true diff --git a/config/puppet-modules/openstack/puppet-ceph-3.1.1/debian/patches/0001-Roll-up-TIS-patches.patch b/config/puppet-modules/openstack/puppet-ceph-3.1.1/debian/patches/0001-Roll-up-TIS-patches.patch new file mode 100644 index 000000000..955008c06 --- /dev/null +++ b/config/puppet-modules/openstack/puppet-ceph-3.1.1/debian/patches/0001-Roll-up-TIS-patches.patch @@ -0,0 +1,92 @@ +From 6a7e54f768b4f28a69ed5948a60765c10d5a4840 Mon Sep 17 00:00:00 2001 +From: Don Penney +Date: Tue, 10 Jan 2017 13:31:17 -0500 +Subject: [PATCH 1/5] Roll up TIS patches + +--- + manifests/mon.pp | 13 ++++++++++--- + manifests/osd.pp | 9 +++++++++ + 2 files changed, 19 insertions(+), 3 deletions(-) + +diff --git a/manifests/mon.pp b/manifests/mon.pp +index f8dad43..cbf753a 100644 +--- a/manifests/mon.pp ++++ b/manifests/mon.pp +@@ -65,6 +65,8 @@ define ceph::mon ( + $authentication_type = 'cephx', + $key = undef, + $keyring = undef, ++ $fsid = undef, ++ $service_ensure = 'running', + $exec_timeout = $ceph::params::exec_timeout, + ) { + +@@ -115,6 +117,9 @@ define ceph::mon ( + if $key and $keyring { + fail("key (set to ${key}) and keyring (set to ${keyring}) are mutually exclusive") + } ++ if $fsid { ++ $fsid_option = "--fsid ${fsid}" ++ } + if $key { + $keyring_path = "/tmp/ceph-mon-keyring-${id}" + +@@ -176,7 +181,8 @@ if [ ! -d \$mon_data ] ; then + --setuser ceph --setgroup ceph \ + --mkfs \ + --id ${id} \ +- --keyring ${keyring_path} ; then ++ --keyring ${keyring_path} \ ++ ${fsid_option} ; 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 +@@ -186,7 +192,8 @@ if [ ! -d \$mon_data ] ; then + if ceph-mon ${cluster_option} \ + --mkfs \ + --id ${id} \ +- --keyring ${keyring_path} ; then ++ --keyring ${keyring_path} \ ++ ${fsid_option} ; then + touch \$mon_data/done \$mon_data/${init} \$mon_data/keyring + else + rm -fr \$mon_data +@@ -203,7 +210,7 @@ test -d \$mon_data + timeout => $exec_timeout, + } + -> service { $mon_service: +- ensure => running, ++ ensure => $service_ennsure, + } + + # if the service is running before we setup the configs, notify service +diff --git a/manifests/osd.pp b/manifests/osd.pp +index ac44a2c..7de3a53 100644 +--- a/manifests/osd.pp ++++ b/manifests/osd.pp +@@ -70,6 +70,8 @@ define ceph::osd ( + $ensure = present, + $journal = undef, + $cluster = undef, ++ $cluser_uuid = undef, ++ $uuid = undef, + $bluestore_wal = undef, + $bluestore_db = undef, + $store_type = undef, +@@ -91,6 +93,13 @@ define ceph::osd ( + } + $cluster_option = "--cluster ${cluster_name}" + ++ if $cluster_uuid { ++ $cluster_uuid_option = "--cluster-uuid ${cluster_uuid}" ++ } ++ if $uuid { ++ $uuid_option = "--os-uuid ${uuid}" ++ } ++ + if $store_type { + $osd_type = "--${store_type}" + } else { +-- +2.30.2 + diff --git a/config/puppet-modules/openstack/puppet-ceph-3.1.1/debian/patches/0002-Newton-rebase-fixes.patch b/config/puppet-modules/openstack/puppet-ceph-3.1.1/debian/patches/0002-Newton-rebase-fixes.patch new file mode 100644 index 000000000..b9f057d31 --- /dev/null +++ b/config/puppet-modules/openstack/puppet-ceph-3.1.1/debian/patches/0002-Newton-rebase-fixes.patch @@ -0,0 +1,47 @@ +From e45ab36e8ea77500f80abd2f96cca2c6cf3a4b66 Mon Sep 17 00:00:00 2001 +From: Don Penney +Date: Tue, 7 Feb 2017 15:49:02 -0500 +Subject: [PATCH 2/5] Newton rebase fixes + +--- + manifests/mon.pp | 9 ++++++--- + manifests/osd.pp | 2 +- + 2 files changed, 7 insertions(+), 4 deletions(-) + +diff --git a/manifests/mon.pp b/manifests/mon.pp +index cbf753a..eb5c125 100644 +--- a/manifests/mon.pp ++++ b/manifests/mon.pp +@@ -99,10 +99,13 @@ define ceph::mon ( + } + # Everything else that is supported by puppet-ceph should run systemd. + } else { +- $init = 'systemd' ++ $init = 'sysvinit' + Service { +- name => "ceph-mon@${id}", +- enable => $mon_enable, ++ name => "ceph-mon-${id}", ++ provider => $::ceph::params::service_provider, ++ start => "service ceph start mon.${id}", ++ stop => "service ceph stop mon.${id}", ++ status => "service ceph status mon.${id}", + } + } + +diff --git a/manifests/osd.pp b/manifests/osd.pp +index 7de3a53..1972caa 100644 +--- a/manifests/osd.pp ++++ b/manifests/osd.pp +@@ -77,7 +77,7 @@ define ceph::osd ( + $store_type = undef, + $exec_timeout = $ceph::params::exec_timeout, + $selinux_file_context = 'ceph_var_lib_t', +- $fsid = $ceph::profile::params::fsid, ++ $fsid = undef, + $dmcrypt = false, + $dmcrypt_key_dir = '/etc/ceph/dmcrypt-keys', + ) { +-- +2.30.2 + diff --git a/config/puppet-modules/openstack/puppet-ceph-3.1.1/debian/patches/0003-ceph-jewel-rebase.patch b/config/puppet-modules/openstack/puppet-ceph-3.1.1/debian/patches/0003-ceph-jewel-rebase.patch new file mode 100644 index 000000000..18955b1de --- /dev/null +++ b/config/puppet-modules/openstack/puppet-ceph-3.1.1/debian/patches/0003-ceph-jewel-rebase.patch @@ -0,0 +1,24 @@ +From 5d5949edf970141d12acf50cb8ad624c53f15296 Mon Sep 17 00:00:00 2001 +From: Daniel Badea +Date: Thu, 23 Mar 2017 08:04:31 +0000 +Subject: [PATCH 3/5] ceph jewel rebase + +--- + manifests/mon.pp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/manifests/mon.pp b/manifests/mon.pp +index eb5c125..7cbec0d 100644 +--- a/manifests/mon.pp ++++ b/manifests/mon.pp +@@ -106,6 +106,7 @@ define ceph::mon ( + start => "service ceph start mon.${id}", + stop => "service ceph stop mon.${id}", + status => "service ceph status mon.${id}", ++ enable => $mon_enable, + } + } + +-- +2.30.2 + diff --git a/config/puppet-modules/openstack/puppet-ceph-3.1.1/debian/patches/0004-US92424-Add-OSD-support-for-persistent-naming.patch b/config/puppet-modules/openstack/puppet-ceph-3.1.1/debian/patches/0004-US92424-Add-OSD-support-for-persistent-naming.patch new file mode 100644 index 000000000..19b939d9b --- /dev/null +++ b/config/puppet-modules/openstack/puppet-ceph-3.1.1/debian/patches/0004-US92424-Add-OSD-support-for-persistent-naming.patch @@ -0,0 +1,29 @@ +From c207c353cbf883befa6070ccd80c2b4980a434fe Mon Sep 17 00:00:00 2001 +From: Robert Church +Date: Thu, 13 Apr 2017 20:31:21 -0500 +Subject: [PATCH 4/5] US92424: Add OSD support for persistent naming + +This allows the manifest to provide udev generated /dev/disk/by-* links +to configure the OSDs without requiring any additional changes. The +'readlink -f' will produce the currently enumerated device node +associated with udev link. +--- + manifests/osd.pp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/manifests/osd.pp b/manifests/osd.pp +index 1972caa..2bda784 100644 +--- a/manifests/osd.pp ++++ b/manifests/osd.pp +@@ -84,7 +84,7 @@ define ceph::osd ( + + include ceph::params + +- $data = $name ++ $data = generate('/bin/bash','-c',"/bin/readlink -f ${name}") + + if $cluster { + $cluster_name = $cluster +-- +2.30.2 + diff --git a/config/puppet-modules/openstack/puppet-ceph-3.1.1/debian/patches/0005-Add-StarlingX-specific-restart-command-for-Ceph-moni.patch b/config/puppet-modules/openstack/puppet-ceph-3.1.1/debian/patches/0005-Add-StarlingX-specific-restart-command-for-Ceph-moni.patch new file mode 100644 index 000000000..6b09ae918 --- /dev/null +++ b/config/puppet-modules/openstack/puppet-ceph-3.1.1/debian/patches/0005-Add-StarlingX-specific-restart-command-for-Ceph-moni.patch @@ -0,0 +1,35 @@ +From 5169d43ce8085726d1d9945fef636154a21eaf17 Mon Sep 17 00:00:00 2001 +From: Ovidiu Poncea +Date: Thu, 20 Dec 2018 07:18:55 -0500 +Subject: [PATCH 5/5] Add StarlingX specific restart command for Ceph monitors + +Since we don't use systemd to manage Ceph and we have pmon monitoring we +have to make sure that: +1. Restarting is properly handled as "systemctl restart" will return error + and manifest will fail; +2. Pmon does not check ceph-mon status during restart. Otherwise we risk + getting into a race condition between the puppet restart and pmon + detecting that ceph is down and trying a restart. + +Both are resolved when using /etc/init.d/ceph-init-wrapper restart + +Signed-off-by: Ovidiu Poncea +--- + manifests/mon.pp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/manifests/mon.pp b/manifests/mon.pp +index 7cbec0d..3936529 100644 +--- a/manifests/mon.pp ++++ b/manifests/mon.pp +@@ -106,6 +106,7 @@ define ceph::mon ( + start => "service ceph start mon.${id}", + stop => "service ceph stop mon.${id}", + status => "service ceph status mon.${id}", ++ restart => "/etc/init.d/ceph-init-wrapper restart mon.${id}", + enable => $mon_enable, + } + } +-- +2.30.2 + diff --git a/config/puppet-modules/openstack/puppet-ceph-3.1.1/debian/patches/series b/config/puppet-modules/openstack/puppet-ceph-3.1.1/debian/patches/series new file mode 100644 index 000000000..2f6e6cd06 --- /dev/null +++ b/config/puppet-modules/openstack/puppet-ceph-3.1.1/debian/patches/series @@ -0,0 +1,5 @@ +0001-Roll-up-TIS-patches.patch +0002-Newton-rebase-fixes.patch +0003-ceph-jewel-rebase.patch +0004-US92424-Add-OSD-support-for-persistent-naming.patch +0005-Add-StarlingX-specific-restart-command-for-Ceph-moni.patch