Add initial meta-stx to support StarlingX build
[pti/rtp.git] / meta-stx / recipes-support / puppet / files / puppet-ceph / 0003-Ceph-Jewel-rebase.patch
1 From c9a5520620d313c08e7f751f3469ec5f4c220486 Mon Sep 17 00:00:00 2001
2 From: Daniel Badea <daniel.badea@windriver.com>
3 Date: Thu, 23 Mar 2017 08:04:31 +0000
4 Subject: [PATCH] ceph jewel rebase
5
6 ---
7  manifests/mon.pp          |  1 +
8  manifests/rgw.pp          | 33 +++++++++++++++++++++++++--------
9  manifests/rgw/keystone.pp |  6 +++---
10  3 files changed, 29 insertions(+), 11 deletions(-)
11
12 diff --git a/manifests/mon.pp b/manifests/mon.pp
13 index b3458d6..17cb925 100644
14 --- a/manifests/mon.pp
15 +++ b/manifests/mon.pp
16 @@ -106,6 +106,7 @@ define ceph::mon (
17          start    => "service ceph start mon.${id}",
18          stop     => "service ceph stop mon.${id}",
19          status   => "service ceph status mon.${id}",
20 +        enable   => $mon_enable,
21        }
22      }
23  
24 diff --git a/manifests/rgw.pp b/manifests/rgw.pp
25 index ebc83ce..56fb4a8 100644
26 --- a/manifests/rgw.pp
27 +++ b/manifests/rgw.pp
28 @@ -193,23 +193,40 @@ define ceph::rgw (
29        status   => "systemctl status ceph-radosgw",
30      }
31    } else {
32 +    if $rgw_enable {
33 +      file { "${rgw_data}/sysvinit":
34 +        ensure => present,
35 +        before => Service["radosgw-${name}"],
36 +      }
37 +    }
38 +
39      Service {
40 -      name   => "ceph-radosgw@${name}",
41 -      enable => $rgw_enable,
42 +      name     => "radosgw-${name}",
43 +      start    => 'service radosgw start',
44 +      stop     => 'service radosgw stop',
45 +      status   => 'service radosgw status',
46 +      provider => $::ceph::params::service_provider,
47      }
48    }
49  
50 -  service { $rgw_service:
51 +  #for RHEL/CentOS7, systemctl needs to reload to pickup the ceph-radosgw init file
52 +  if (($::operatingsystem == 'RedHat' or $::operatingsystem == 'CentOS') and (versioncmp($::operatingsystemmajrelease, '7') >= 0))
53 +  {
54 +    exec { 'systemctl-reload-from-rgw': #needed for the new init file
55 +      command => '/usr/bin/systemctl daemon-reload',
56 +    }
57 +  }
58 +  service { "radosgw-${name}":
59      ensure => $rgw_ensure,
60 -    tag    => ['ceph-radosgw']
61 +    tag    => ['radosgw']
62    }
63  
64 -  Ceph_config<||> ~> Service<| tag == 'ceph-radosgw' |>
65 +  Ceph_config<||> -> Service["radosgw-${name}"]
66    Package<| tag == 'ceph' |> -> File['/var/lib/ceph/radosgw']
67    Package<| tag == 'ceph' |> -> File[$log_file]
68    File['/var/lib/ceph/radosgw']
69    -> File[$rgw_data]
70 -  -> Service<| tag == 'ceph-radosgw' |>
71 -  File[$log_file] -> Service<| tag == 'ceph-radosgw' |>
72 -  Ceph::Pool<||> -> Service<| tag == 'ceph-radosgw' |>
73 +  -> Service["radosgw-${name}"]
74 +  File[$log_file] -> Service["radosgw-${name}"]
75 +  Ceph::Pool<||> -> Service["radosgw-${name}"]
76  }
77 diff --git a/manifests/rgw/keystone.pp b/manifests/rgw/keystone.pp
78 index 8351177..c371fd0 100644
79 --- a/manifests/rgw/keystone.pp
80 +++ b/manifests/rgw/keystone.pp
81 @@ -148,7 +148,7 @@ define ceph::rgw::keystone (
82      exec { "${name}-nssdb-ca":
83        command => "/bin/true  # comment to satisfy puppet syntax requirements
84  set -ex
85 -wget --no-check-certificate ${rgw_keystone_url}/v2.0/certificates/ca -O - |
86 +wget --no-check-certificate ${rgw_keystone_url}/${rgw_keystone_version}/certificates/ca -O - |
87    openssl x509 -pubkey | certutil -A -d ${nss_db_path} -n ca -t \"TCu,Cu,Tuw\"
88  ",
89        unless  => "/bin/true  # comment to satisfy puppet syntax requirements
90 @@ -161,7 +161,7 @@ certutil -d ${nss_db_path} -L | grep ^ca
91      exec { "${name}-nssdb-signing":
92        command => "/bin/true  # comment to satisfy puppet syntax requirements
93  set -ex
94 -wget --no-check-certificate ${rgw_keystone_url}/v2.0/certificates/signing -O - |
95 +wget --no-check-certificate ${rgw_keystone_url}/${rgw_keystone_version}/certificates/signing -O - |
96    openssl x509 -pubkey | certutil -A -d ${nss_db_path} -n signing_cert -t \"P,P,P\"
97  ",
98        unless  => "/bin/true  # comment to satisfy puppet syntax requirements
99 @@ -176,7 +176,7 @@ certutil -d ${nss_db_path} -L | grep ^signing_cert
100      -> File[$nss_db_path]
101      -> Exec["${name}-nssdb-ca"]
102      -> Exec["${name}-nssdb-signing"]
103 -    ~> Service<| tag == 'ceph-radosgw' |>
104 +    ~> Service<| tag == 'radosgw' |>
105    } else {
106      ceph_config {
107        "client.${name}/nss_db_path":                      ensure => absent;
108 -- 
109 2.7.4
110