Jcrespo has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/364466 )

Change subject: mariadb: Fix default package installation for stretch
......................................................................

mariadb: Fix default package installation for stretch

On stretch, default to install MariaDB 10.1 instead of 10.0.

Bug: T168356
Change-Id: I47053cae150a845a79ce4dfc1cf58a68d998393f
---
M modules/mariadb/manifests/packages_wmf.pp
1 file changed, 24 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/66/364466/1

diff --git a/modules/mariadb/manifests/packages_wmf.pp 
b/modules/mariadb/manifests/packages_wmf.pp
index 71df1fc..02bb19e 100644
--- a/modules/mariadb/manifests/packages_wmf.pp
+++ b/modules/mariadb/manifests/packages_wmf.pp
@@ -4,7 +4,7 @@
 
 class mariadb::packages_wmf(
     $mariadb10 = true,        # deprecated parameter, do not use
-    $package   = 'wmf-mariadb10',
+    $package   = 'undefined',
 #    $version   = None,          # reserved for future usage
     ) {
 
@@ -36,25 +36,36 @@
         }
     }
     else {
-        case $package {
+        # if not defined, default to 10.1 on stretch, 10.0 elsewhere
+        if $package == 'undefined' {
+            if os_version('debian >= stretch') {
+                $mariadb_package = 'wmf-mariadb101'
+            } else {
+                $mariadb_package = 'wmf-mariadb10'
+            }
+        } else {
+            $mariadb_package = $package
+        }
+
+        case $mariadb_package {
             'wmf-mariadb', 'wmf-mariadb10', 'wmf-mariadb101', 'wmf-mysql57' :
             {
-                package { $package:
+                package { $mariadb_package:
                     ensure => present,
                 }
-
-                # if you have installed the wmf mariadb package,
-                # create a custom, safer mysqld_safe
-                # New packages include it, but old packages have
-                # to be overwritten still - do not retire at least
-                # until version > 10.0.27
-                class { 'mariadb::mysqld_safe':
-                    package => $package,
-                }
+                if !os_version('debian >= stretch') {
+                    # if you have installed the wmf mariadb package,
+                    # create a custom, safer mysqld_safe
+                    # New packages include it, but old packages have
+                    # to be overwritten still - do not retire at least
+                    # until version > 10.0.27
+                    class { 'mariadb::mysqld_safe':
+                        package => $mariadb_package,
+                    }
             }
             default :
             {
-                fail("Invalid package version \"${package}\". \
+                fail("Invalid package version \"${mariadb_package}\". \
 The only allowed versions are: wmf-mariadb10, wmf-mariadb101 or wmf-mysql57")
             }
         }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I47053cae150a845a79ce4dfc1cf58a68d998393f
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Jcrespo <[email protected]>

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

Reply via email to