summaryrefslogtreecommitdiff
path: root/manifests/init.pp
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/init.pp')
-rw-r--r--manifests/init.pp29
1 files changed, 29 insertions, 0 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
new file mode 100644
index 0000000..f361742
--- /dev/null
+++ b/manifests/init.pp
@@ -0,0 +1,29 @@
+class database {
+ class { 'mysql::server': }
+
+ # See http://www.smilecouple.org/2011/03/01/fix-out-of-resource-problem-with-mysql
+ file { '/etc/security/limits.d/mysql.conf':
+ ensure => absent,
+ owner => root,
+ group => root,
+ mode => 0644,
+ content => "mysql soft nofile 24000\nmysql hard nofile 32000\n",
+ }
+
+ # Avoid Errcode: 24
+ file { '/etc/mysql/conf.d/mysqld_open_files_limit.cnf':
+ ensure => present,
+ owner => root,
+ group => root,
+ mode => 0644,
+ content => "[mysqld]\nopen-files-limit = 500000\n",
+ 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',
+ }
+}