aboutsummaryrefslogtreecommitdiff
path: root/manifests/subsystems/database.pp
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2013-04-12 17:09:03 -0300
committerSilvio Rhatto <rhatto@riseup.net>2013-04-12 17:09:03 -0300
commitfe1c86b8f938283e9dd8196a8b11a9648f4b49e6 (patch)
treec2d999eca03862a3e4af57e0885397adf6bbc6ec /manifests/subsystems/database.pp
parentec5c750d12bdc7948bb3c04f0c72817718a0bf47 (diff)
downloadpuppet-nodo-fe1c86b8f938283e9dd8196a8b11a9648f4b49e6.tar.gz
puppet-nodo-fe1c86b8f938283e9dd8196a8b11a9648f4b49e6.tar.bz2
Major refactor
Diffstat (limited to 'manifests/subsystems/database.pp')
-rw-r--r--manifests/subsystems/database.pp52
1 files changed, 0 insertions, 52 deletions
diff --git a/manifests/subsystems/database.pp b/manifests/subsystems/database.pp
deleted file mode 100644
index beedfa6..0000000
--- a/manifests/subsystems/database.pp
+++ /dev/null
@@ -1,52 +0,0 @@
-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',
- }
-
- # Database definitions
- define instance($password, $ensure = 'present', $privileges = "all") {
- include mysql::server
-
- mysql_database { "${name}":
- ensure => $ensure,
- require => Service['mysql'],
- }
-
- mysql_user { "${name}@%":
- ensure => $ensure,
- password_hash => mysql_password($password),
- require => Mysql_database["${name}"],
- }
-
- if $ensure == 'present' {
- mysql_grant { "${name}@%/${name}":
- privileges => $privileges,
- require => Mysql_user["${name}@%"],
- }
- }
- }
-}