Marostegui has submitted this change and it was merged.

Change subject: mariadb: Split backup and otrsbackups classes into a different 
file
......................................................................


mariadb: Split backup and otrsbackups classes into a different file

After some discussions with Jaime we thought that we could slowly
start moving things out from mariadb.pp file into single files
which will make things clearer and easy to manage.

For this first approach I took backup and otrsbackups classes
into a different files in a new directory "mariadb"

Bug: T150851
Change-Id: I804b6df9f9d4c584dc78f5053b18a0a11e335b4a
---
M modules/role/manifests/mariadb.pp
A modules/role/manifests/mariadb/backup.pp
A modules/role/manifests/mariadb/otrsbackups.pp
3 files changed, 66 insertions(+), 68 deletions(-)

Approvals:
  Jcrespo: Looks good to me, but someone else must approve
  Marostegui: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/role/manifests/mariadb.pp 
b/modules/role/manifests/mariadb.pp
index 8760f9d..f7cbaf4 100644
--- a/modules/role/manifests/mariadb.pp
+++ b/modules/role/manifests/mariadb.pp
@@ -577,40 +577,6 @@
     }
 }
 
-class role::mariadb::backup {
-    include role::backup::host
-    include passwords::mysql::dump
-
-    file { '/srv/backups':
-        ensure => directory,
-        owner  => 'root',
-        group  => 'root',
-        mode   => '0600', # implicitly 0700 for dirs
-    }
-
-    file { '/etc/mysql/conf.d/dumps.cnf':
-        ensure  => present,
-        owner   => 'root',
-        group   => 'root',
-        mode    => '0400',
-        content => 
"[client]\nuser=${passwords::mysql::dump::user}\npassword=${passwords::mysql::dump::pass}\n",
-    }
-
-    backup::mysqlset {'dbstore':
-        xtrabackup       => false,
-        per_db           => true,
-        innodb_only      => true,
-        binlog           => false,
-        slave            => true,
-        local_dump_dir   => '/srv/backups',
-        password_file    => '/etc/mysql/conf.d/dumps.cnf',
-        method           => 'predump',
-        mysql_binary     => '/usr/local/bin/mysql',
-        mysqldump_binary => '/usr/local/bin/mysqldump',
-        jobdefaults      => 
"Weekly-${role::backup::host::day}-${role::backup::host::pool}",
-    }
-}
-
 class role::mariadb::core(
     $shard,
     $ssl           = 'puppet-cert',
@@ -1064,40 +1030,6 @@
         tendril_user     => 'watchdog',
         tendril_password => $passwords::tendril::db_pass,
     }
-}
-
-class role::mariadb::otrsbackups {
-    include role::backup::host
-
-    file { '/srv/backups':
-        ensure => directory,
-        owner  => 'root',
-        group  => 'root',
-        mode   => '0600', # implicitly 0700 for dirs
-    }
-
-    file { '/usr/local/bin/dumps-otrs.sh':
-        owner   => 'root',
-        group   => 'root',
-        mode    => '0755',
-        content => template('mariadb/dumps-otrs.sh.erb'),
-    }
-
-    cron { 'otrsbackups':
-        minute   => '0',
-        hour     => '0',
-        monthday => '*',
-        month    => '*',
-        weekday  => '3',
-        command  => '/usr/local/bin/dumps-otrs.sh > /srv/backups/dump.log 
2>&1',
-        user     => 'root',
-        require  => [
-            File['/usr/local/bin/dumps-otrs.sh'],
-            File['/srv/backups'],
-        ],
-    }
-
-    backup::set {'otrsdb': }
 }
 
 # hosts with client utilities to conect to remote servers
diff --git a/modules/role/manifests/mariadb/backup.pp 
b/modules/role/manifests/mariadb/backup.pp
new file mode 100644
index 0000000..135b5cf
--- /dev/null
+++ b/modules/role/manifests/mariadb/backup.pp
@@ -0,0 +1,33 @@
+class role::mariadb::backup {
+    include role::backup::host
+    include passwords::mysql::dump
+
+    file { '/srv/backups':
+        ensure => directory,
+        owner  => 'root',
+        group  => 'root',
+        mode   => '0600', # implicitly 0700 for dirs
+    }
+
+    file { '/etc/mysql/conf.d/dumps.cnf':
+        ensure  => present,
+        owner   => 'root',
+        group   => 'root',
+        mode    => '0400',
+        content => 
"[client]\nuser=${passwords::mysql::dump::user}\npassword=${passwords::mysql::dump::pass}\n",
+    }
+
+    backup::mysqlset {'dbstore':
+        xtrabackup       => false,
+        per_db           => true,
+        innodb_only      => true,
+        binlog           => false,
+        slave            => true,
+        local_dump_dir   => '/srv/backups',
+        password_file    => '/etc/mysql/conf.d/dumps.cnf',
+        method           => 'predump',
+        mysql_binary     => '/usr/local/bin/mysql',
+        mysqldump_binary => '/usr/local/bin/mysqldump',
+        jobdefaults      => 
"Weekly-${role::backup::host::day}-${role::backup::host::pool}",
+    }
+}
diff --git a/modules/role/manifests/mariadb/otrsbackups.pp 
b/modules/role/manifests/mariadb/otrsbackups.pp
new file mode 100644
index 0000000..ac98c75
--- /dev/null
+++ b/modules/role/manifests/mariadb/otrsbackups.pp
@@ -0,0 +1,33 @@
+class role::mariadb::otrsbackups {
+    include role::backup::host
+
+    file { '/srv/backups':
+        ensure => directory,
+        owner  => 'root',
+        group  => 'root',
+        mode   => '0600', # implicitly 0700 for dirs
+    }
+
+    file { '/usr/local/bin/dumps-otrs.sh':
+        owner   => 'root',
+        group   => 'root',
+        mode    => '0755',
+        content => template('mariadb/dumps-otrs.sh.erb'),
+    }
+
+    cron { 'otrsbackups':
+        minute   => '0',
+        hour     => '0',
+        monthday => '*',
+        month    => '*',
+        weekday  => '3',
+        command  => '/usr/local/bin/dumps-otrs.sh > /srv/backups/dump.log 
2>&1',
+        user     => 'root',
+        require  => [
+            File['/usr/local/bin/dumps-otrs.sh'],
+            File['/srv/backups'],
+        ],
+    }
+
+    backup::set {'otrsdb': }
+}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I804b6df9f9d4c584dc78f5053b18a0a11e335b4a
Gerrit-PatchSet: 4
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Marostegui <maroste...@wikimedia.org>
Gerrit-Reviewer: Jcrespo <jcre...@wikimedia.org>
Gerrit-Reviewer: Marostegui <maroste...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to