From 35613fe0e9de8e8229862c939d3c9fb8890a1db2 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Wed, 5 Sep 2012 13:22:48 -0300 Subject: Including mysql backup at database class; adding --single-transaction sql dump option to avoid 'out of resources' error --- manifests/desktop.pp | 6 ------ manifests/laptop.pp | 6 ------ manifests/mail.pp | 7 ++++--- manifests/master.pp | 6 ------ manifests/subsystems/database.pp | 7 +++++++ manifests/web.pp | 6 ------ 6 files changed, 11 insertions(+), 27 deletions(-) diff --git a/manifests/desktop.pp b/manifests/desktop.pp index c87d454..e7496c2 100644 --- a/manifests/desktop.pp +++ b/manifests/desktop.pp @@ -43,12 +43,6 @@ class nodo::desktop::webdev inherits nodo::desktop { include websites::dev include database include utils::web - - backupninja::mysql { "all_databases": - backupdir => '/var/backups/mysql', - compress => true, - sqldump => true, - } } class nodo::desktop::dev { diff --git a/manifests/laptop.pp b/manifests/laptop.pp index 34fde33..e088de1 100644 --- a/manifests/laptop.pp +++ b/manifests/laptop.pp @@ -58,12 +58,6 @@ class nodo::laptop::webdev inherits nodo::laptop { include websites::dev include database include utils::web - - backupninja::mysql { "all_databases": - backupdir => '/var/backups/mysql', - compress => true, - sqldump => true, - } } class nodo::laptop::dev { diff --git a/manifests/mail.pp b/manifests/mail.pp index c82aac6..18a4a08 100644 --- a/manifests/mail.pp +++ b/manifests/mail.pp @@ -17,8 +17,9 @@ class nodo::mail { include mail::system backupninja::mysql { "all_databases": - backupdir => '/var/backups/mysql', - compress => true, - sqldump => true, + backupdir => '/var/backups/mysql', + compress => true, + sqldump => true, + sqldumpoptions => '--lock-tables --complete-insert --add-drop-table --quick --quote-names --single-transaction', } } diff --git a/manifests/master.pp b/manifests/master.pp index 79cfb72..3bf276c 100644 --- a/manifests/master.pp +++ b/manifests/master.pp @@ -61,12 +61,6 @@ class nodo::master { password => "$puppetmaster_db_password", } - backupninja::mysql { "all_databases": - backupdir => '/var/backups/mysql', - compress => true, - sqldump => true, - } - # Used for trac dependency graphs package { "graphviz": ensure => present, diff --git a/manifests/subsystems/database.pp b/manifests/subsystems/database.pp index d205ad6..17500ff 100644 --- a/manifests/subsystems/database.pp +++ b/manifests/subsystems/database.pp @@ -20,6 +20,13 @@ class database { notify => Service['mysql'], } + backupninja::mysql { "all_databases": + backupdir => '/var/backups/mysql', + compress => true, + sqldump => true, + sqldumpoptions => '--lock-tables --complete-insert --add-drop-table --quick --quote-names --single-transaction', + } + # Database definitions define instance($password, $ensure = 'present', $privileges = 'all') { mysql_database { "$name": diff --git a/manifests/web.pp b/manifests/web.pp index caf031a..ef05dbe 100644 --- a/manifests/web.pp +++ b/manifests/web.pp @@ -24,10 +24,4 @@ class nodo::web inherits nodo::vserver { backupninja::svn { "svn": src => "/var/svn", } - - backupninja::mysql { "all_databases": - backupdir => '/var/backups/mysql', - compress => true, - sqldump => true, - } } -- cgit v1.2.3