Jcrespo has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/363840 )

Change subject: mariadb: Fix service for hosts with a default package
......................................................................


mariadb: Fix service for hosts with a default package

$package probably should be defined on the role everywhere, for
now we will allow to not set a default, and default to sane
options.

This fixes previous deployment of f13be9f5a2949f, which failed due
to not being able to create local variables on puppet with the
same name than a parameter.

Bug: T169514
Change-Id: I0ee40fa099446eee59a2255631a04ff8337e3309
---
M modules/mariadb/manifests/service.pp
1 file changed, 8 insertions(+), 4 deletions(-)

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



diff --git a/modules/mariadb/manifests/service.pp 
b/modules/mariadb/manifests/service.pp
index 6247a22..3aaabfe 100644
--- a/modules/mariadb/manifests/service.pp
+++ b/modules/mariadb/manifests/service.pp
@@ -32,9 +32,11 @@
     if os_version('debian >= stretch') {
         # On stretch+, default to MariaDB 10.1
         if $package == 'undefined' {
-            $package = 'wmf-mariadb101'
+            $installed_package = 'wmf-mariadb101'
+        } else {
+            $installed_package = $package
         }
-        case $package {
+        case $installed_package {
             'wmf-mysql57', 'wmf-mysql80': { $vendor = 'mysql' }
             default:                      { $vendor = 'mariadb' }
         }
@@ -80,7 +82,9 @@
     } else {
         # Before stretch, default to MariaDB 10.0
         if $package == 'undefined' {
-            $package = 'wmf-mariadb10'
+            $installed_package = 'wmf-mariadb10'
+        } else {
+            $installed_package = $package
         }
 
         file { "${initd_basedir}/service":
@@ -89,7 +93,7 @@
             group   => 'root',
             mode    => '0755',
             content => template('mariadb/mariadb.server.erb'),
-            require => Package[$package],
+            require => Package[$installed_package],
         }
 
         file { '/etc/init.d/mysql':

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

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

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

Reply via email to