integ/config/puppet-modules/openstack/puppet-ceph-2.4.1/debian/patches/0006-ceph-disk-prepare-invalid-data-disk-value.patch
Dan Voiculeasa bac46cc0e0 debian: Replace puppet-module-ceph-3.1.1 with 2.4.1
This work is part of Debian integration effort. This work only affects
debian.

We package the same version of ceph for both CentOS and Debian.
Since we know the puppet-ceph module on CentOS is supposed to work,
use this on Debian also to reduce testing and possible issues.

Patches were copied from CentOS and not touched.
Drop one patch to metadata.json, we know we have some work to do in
that area to clear puppet warnings, but will be done part of a
generic clearing puppet warnings effort.

The sources need to be patched to work with debhelper-compat 13, which
we don't care now.

There are some integration issues, but testing so far revealed that
during a puppet replay for aio manifest ceph data and ceph journal
partitions were created.

Story: 2009101
Task: 43431
Signed-off-by: Dan Voiculeasa <dan.voiculeasa@windriver.com>
Change-Id: I90adc736ea52e6c4f9946520156f53e572c224cc
2022-03-11 11:38:20 +02:00

69 lines
2.8 KiB
Diff

From 5d8f3dd5d18d611151b4658c5c876e8a3ad8fe51 Mon Sep 17 00:00:00 2001
From: Daniel Badea <daniel.badea@windriver.com>
Date: Wed, 31 Oct 2018 16:28:45 +0000
Subject: [PATCH] ceph-disk prepare invalid data disk value
ceph-disk prepare data OSD parameter contains a new line causing
puppet manifest to fail:
1. $data = generate('/bin/bash','-c',"/bin/readlink -f ${name}")
is expanded together with a new line in:
exec { $ceph_prepare:
command => "/usr/sbin/ceph-disk prepare ${cluster_option}
${cluster_uuid_option} ${uuid_option}
--fs-type xfs --zap-disk ${data} ${journal}"
just before ${journal} is expanded. Puppet reports:
sh: line 1: : command not found
when trying to run '' (default journal value).
2. 'readlink' should be called when running ceph-disk prepare
command, not when the puppet resource is defined. Let
exec's shell call readlink instead of using puppet's
generate() . See also:
https://github.com/openstack/puppet-ceph/commit/ff2b2e689846dd3d980c7c706c591e8cfb8f33a9
Added --verbose and --log-stdout options to log commands executed
by 'ceph-disk prepare' and identify where it fails.
---
manifests/osd.pp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/manifests/osd.pp b/manifests/osd.pp
index d9cf5b1..889d28a 100644
--- a/manifests/osd.pp
+++ b/manifests/osd.pp
@@ -61,7 +61,7 @@ define ceph::osd (
include ::ceph::params
- $data = generate('/bin/bash','-c',"/bin/readlink -f ${name}")
+ $data = $name
if $cluster {
$cluster_name = $cluster
@@ -131,13 +131,13 @@ test -z $(ceph-disk list $(readlink -f ${data}) | egrep -o '[0-9a-f]{8}-([0-9a-f
# ceph-disk: prepare should be idempotent http://tracker.ceph.com/issues/7475
exec { $ceph_prepare:
- command => "/usr/sbin/ceph-disk prepare ${cluster_option} ${cluster_uuid_option} ${uuid_option} --fs-type xfs --zap-disk ${data} ${journal}",
+ command => "/usr/sbin/ceph-disk --verbose --log-stdout prepare ${cluster_option} ${cluster_uuid_option} ${uuid_option} --fs-type xfs --zap-disk $(readlink -f ${data}) $(readlink -f ${journal})",
# We don't want to erase the disk if:
# 1. There is already ceph data on the disk for our cluster AND
# 2. The uuid for the OSD we are configuring matches the uuid for the
# OSD on the disk. We don't want to attempt to re-use an OSD that
# had previously been deleted.
- unless => "/usr/sbin/ceph-disk list | grep -v 'unknown cluster' | grep ' *${data}.*ceph data' | grep 'osd uuid ${uuid}'",
+ unless => "/usr/sbin/ceph-disk list | grep -v 'unknown cluster' | grep \" *$(readlink -f ${data}).*ceph data\" | grep 'osd uuid ${uuid}'",
logoutput => true,
timeout => $exec_timeout,
--
2.16.5