Add initial meta-stx to support StarlingX build
[pti/rtp.git] / meta-stx / recipes-support / puppet / files / puppet-drbd / 0007-Add-disk-by-path-test.patch
1 From 30ae8c86d9471980a0058823d6593e7548e19506 Mon Sep 17 00:00:00 2001
2 From: Don Penney <don.penney@windriver.com>
3 Date: Thu, 15 Jun 2017 17:34:30 -0400
4 Subject: [PATCH] Add disk by-path test
5
6 ---
7  manifests/resource/up.pp | 14 +++++++++++++-
8  1 file changed, 13 insertions(+), 1 deletion(-)
9
10 diff --git a/manifests/resource/up.pp b/manifests/resource/up.pp
11 index 3e2fdac..ea379a8 100644
12 --- a/manifests/resource/up.pp
13 +++ b/manifests/resource/up.pp
14 @@ -8,6 +8,17 @@ define drbd::resource::up (
15    $mountpoint,
16    $automount,
17  ) {
18 +
19 +  # Ensure disk by-path link exists
20 +  exec { "test disk by-path for ${name}":
21 +    command => "udevadm settle",
22 +    unless => "test -e ${disk}",
23 +    before => Service['drbd'],
24 +    require => [
25 +        Exec['modprobe drbd']
26 +      ],
27 +  }
28 +
29    # create metadata on device, except if resource seems already initalized.
30    # drbd is very tenacious about asking for aproval if there is data on the
31    # volume already.
32 @@ -18,6 +29,7 @@ define drbd::resource::up (
33      before  => Service['drbd'],
34      require => [
35        Exec['modprobe drbd'],
36 +      Exec["test disk by-path for ${name}"],
37        Concat["/etc/drbd.d/${name}.res"],
38        ],
39      notify  => Service['drbd'],
40 @@ -35,7 +47,7 @@ define drbd::resource::up (
41      notify  => Service['drbd'],
42    }
43  
44 -  exec { "reuse existing DRBD resoure ${name}":
45 +  exec { "reuse existing DRBD resource ${name}":
46      command => "drbdadm adjust ${name}",
47      onlyif  => "test -e ${disk} && (drbdadm show-gi ${name} | grep 'meta-data: need apply-al')",
48      before  => Service['drbd'],
49 -- 
50 1.8.3.1
51