diff --git a/manifests/osd.pp b/manifests/osd.pp index 0d09e1df..d7595a5b 100644 --- a/manifests/osd.pp +++ b/manifests/osd.pp @@ -123,6 +123,7 @@ test -z \$(ceph-disk list ${data} | egrep -o '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a command => "/bin/true # comment to satisfy puppet syntax requirements set -ex if ! test -b ${data} ; then + echo ${data} | egrep -e '^/dev' -q -v mkdir -p ${data} if getent passwd ceph >/dev/null 2>&1; then chown -h ceph:ceph ${data} @@ -156,6 +157,7 @@ ceph-disk list | grep -E ' *${data}1? .*ceph data, (prepared|active)' || command => "/bin/true # comment to satisfy puppet syntax requirements set -ex if ! test -b ${data} ; then + echo ${data} | egrep -e '^/dev' -q -v mkdir -p ${data} if getent passwd ceph >/dev/null 2>&1; then chown -h ceph:ceph ${data} diff --git a/releasenotes/notes/osd-check-non-existent-block-device-6f827dba142a3aa5.yaml b/releasenotes/notes/osd-check-non-existent-block-device-6f827dba142a3aa5.yaml new file mode 100644 index 00000000..eb0d30b3 --- /dev/null +++ b/releasenotes/notes/osd-check-non-existent-block-device-6f827dba142a3aa5.yaml @@ -0,0 +1,3 @@ +--- +fixes: + - Bug 1665697 non-existent block device should make deploy fail, not create directory whose name starts with /dev \ No newline at end of file diff --git a/spec/defines/ceph_osd_spec.rb b/spec/defines/ceph_osd_spec.rb index 211f8315..284ca4c5 100644 --- a/spec/defines/ceph_osd_spec.rb +++ b/spec/defines/ceph_osd_spec.rb @@ -46,6 +46,7 @@ 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 set -ex if ! test -b /srv ; then + echo /srv | egrep -e '^/dev' -q -v mkdir -p /srv if getent passwd ceph >/dev/null 2>&1; then chown -h ceph:ceph /srv @@ -65,6 +66,7 @@ ceph-disk list | grep -E ' */srv1? .*ceph data, (prepared|active)' || 'command' => "/bin/true # comment to satisfy puppet syntax requirements set -ex if ! test -b /srv ; then + echo /srv | egrep -e '^/dev' -q -v mkdir -p /srv if getent passwd ceph >/dev/null 2>&1; then chown -h ceph:ceph /srv @@ -128,6 +130,7 @@ test -z \$(ceph-disk list /srv/data | egrep -o '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0- 'command' => "/bin/true # comment to satisfy puppet syntax requirements set -ex if ! test -b /srv/data ; then + echo /srv/data | egrep -e '^/dev' -q -v mkdir -p /srv/data if getent passwd ceph >/dev/null 2>&1; then chown -h ceph:ceph /srv/data @@ -147,6 +150,7 @@ ceph-disk list | grep -E ' */srv/data1? .*ceph data, (prepared|active)' || 'command' => "/bin/true # comment to satisfy puppet syntax requirements set -ex if ! test -b /srv/data ; then + echo /srv/data | egrep -e '^/dev' -q -v mkdir -p /srv/data if getent passwd ceph >/dev/null 2>&1; then chown -h ceph:ceph /srv/data