Faidon Liambotis has submitted this change and it was merged.

Change subject: sslcert: include ::chainedcert from ::certificate
......................................................................


sslcert: include ::chainedcert from ::certificate

Since all of our current users of ::certificate/::chainedcert happen
together, avoid the extra call and call ::chainedcert from certificate
(but provide an option to disable that).

Change-Id: I8d97435aba9f6b2657d15ca6b48a39de2f5208ba
---
M manifests/certs.pp
M modules/sslcert/manifests/certificate.pp
M modules/sslcert/manifests/chainedcert.pp
3 files changed, 13 insertions(+), 5 deletions(-)

Approvals:
  Faidon Liambotis: Verified; Looks good to me, approved
  BBlack: Looks good to me, but someone else must approve



diff --git a/manifests/certs.pp b/manifests/certs.pp
index 73cd4fa..a7ec956 100644
--- a/manifests/certs.pp
+++ b/manifests/certs.pp
@@ -16,8 +16,4 @@
             private => "puppet:///private/ssl/${name}.key",
         }
     }
-
-    sslcert::chainedcert { $name:
-        group => $group,
-    }
 }
diff --git a/modules/sslcert/manifests/certificate.pp 
b/modules/sslcert/manifests/certificate.pp
index ab48270..779e2ef 100644
--- a/modules/sslcert/manifests/certificate.pp
+++ b/modules/sslcert/manifests/certificate.pp
@@ -19,6 +19,10 @@
 #   If 'present', the certificate will be installed; if 'absent', it will be
 #   removed. The default is 'present'.
 #
+# [*chain*]
+#   If true, create also a chained version of the certificate, by calling into
+#   sslcert::chainedcert. The default is true.
+#
 # [*content*]
 #   If defined, will be used as the content of the X.509 certificate file.
 #   Undefined by default. Mutually exclusive with 'source'.
@@ -41,6 +45,7 @@
 define sslcert::certificate(
   $ensure=present,
   $group='ssl-cert',
+  $chain=true,
   $source=undef,
   $content=undef,
   $private=undef,
@@ -76,4 +81,11 @@
             source => $private,
         }
     }
+
+    if $chain {
+        sslcert::chainedcert { $name:
+            ensure => $ensure,
+            group  => $group,
+        }
+    }
 }
diff --git a/modules/sslcert/manifests/chainedcert.pp 
b/modules/sslcert/manifests/chainedcert.pp
index cc75b26..2f0e3b3 100644
--- a/modules/sslcert/manifests/chainedcert.pp
+++ b/modules/sslcert/manifests/chainedcert.pp
@@ -39,7 +39,7 @@
             creates => $chainfile,
             command => "/usr/local/sbin/x509-bundle --skip-root -c 
${title}.crt -o $chainfile",
             cwd     => '/etc/ssl/localcerts',
-            require => Sslcert::Certificate[$title],
+            require => File["/etc/ssl/localcerts/${title}.crt"]
         }
 
         # set owner/group/permissions on the chained file

-- 
To view, visit https://gerrit.wikimedia.org/r/215350
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I8d97435aba9f6b2657d15ca6b48a39de2f5208ba
Gerrit-PatchSet: 4
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Faidon Liambotis <[email protected]>
Gerrit-Reviewer: BBlack <[email protected]>
Gerrit-Reviewer: Faidon Liambotis <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to