Volans has submitted this change and it was merged.

Change subject: Refactor of the CAs certificate genearation
......................................................................


Refactor of the CAs certificate genearation

- Refactored without the use of the missing Puppet module concat
- Created the option 'multiple-ca' for the $ssl variable

Bug: T111654
Change-Id: Idaf1336186a78fe04ec2cd2460729981a6645a91
---
M manifests/config.pp
1 file changed, 13 insertions(+), 17 deletions(-)

Approvals:
  Volans: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/manifests/config.pp b/manifests/config.pp
index 77f25f4..9aa89f2 100644
--- a/manifests/config.pp
+++ b/manifests/config.pp
@@ -83,7 +83,7 @@
         source => 'puppet:///files/icinga/check_mariadb.pl',
     }
 
-    if ($ssl == 'on') {
+    if ($ssl == 'on' or $ssl == 'multiple-ca') {
 
         file { '/etc/mysql/ssl':
             ensure  => directory,
@@ -149,30 +149,26 @@
             user            => 'mysql',
             group           => 'mysql',
         }
+    }
 
+    if ($ssl == 'multiple-ca') {
         # Temporary CA certificate with multiple PEM for backward compatibility
-        concat { '/etc/mysql/ssl/ca.crt':
-            ensure  => present,
-            owner   => 'mysql',
-            group   => 'mysql',
-            mode    => '0444',
-            warn    => true,
+        # Rewritten with exec because of the missing concat module
+        exec { 'multiple-ca':
+            command => '/bin/cat /etc/ssl/certs/Puppet_Internal_CA.pem 
/etc/mysql/ssl/cacert.pem > /etc/mysql/ssl/ca.crt',
+            creates => '/etc/mysql/ssl/ca.crt',
             require => [
                 File['/etc/ssl/certs/Puppet_Internal_CA.pem'],
                 File['/etc/mysql/ssl/cacert.pem'],
             ],
         }
 
-        concat::fragment { 'mysql_ca':
-            target  => '/etc/mysql/ssl/ca.crt',
-            content => file('/etc/mysql/ssl/cacert.pem'),
-            order   => '01',
-        }
-
-        concat::fragment { 'puppet_ca':
-            target  => '/etc/mysql/ssl/ca.crt',
-            content => file('/etc/ssl/certs/Puppet_Internal_CA.pem'),
-            order   => '02',
+        file { '/etc/mysql/ssl/ca.crt':
+            ensure  => present,
+            owner   => 'mysql',
+            group   => 'mysql',
+            mode    => '0444',
+            require => Exec['multiple-ca'],
         }
 
     }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Idaf1336186a78fe04ec2cd2460729981a6645a91
Gerrit-PatchSet: 2
Gerrit-Project: operations/puppet/mariadb
Gerrit-Branch: master
Gerrit-Owner: Volans <[email protected]>
Gerrit-Reviewer: Jcrespo <[email protected]>
Gerrit-Reviewer: Volans <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to