diff --git a/modules.env b/modules.env index 1599ed2ca8..a1221d1c05 100644 --- a/modules.env +++ b/modules.env @@ -65,6 +65,7 @@ INTEGRATION_MODULES["https://git.openstack.org/openstack-infra/puppet-kibana"]=" INTEGRATION_MODULES["https://git.openstack.org/openstack-infra/puppet-lodgeit"]="origin/master" INTEGRATION_MODULES["https://git.openstack.org/openstack-infra/puppet-logstash"]="origin/master" INTEGRATION_MODULES["https://git.openstack.org/openstack-infra/puppet-meetbot"]="origin/master" +INTEGRATION_MODULES["https://git.openstack.org/openstack-infra/puppet-mysql_backup"]="origin/master" INTEGRATION_MODULES["https://git.openstack.org/openstack-infra/puppet-nodepool"]="origin/master" INTEGRATION_MODULES["https://git.openstack.org/openstack-infra/puppet-jenkins"]="origin/master" INTEGRATION_MODULES["https://git.openstack.org/openstack-infra/puppet-pip"]="origin/master" diff --git a/modules/mysql_backup/manifests/backup.pp b/modules/mysql_backup/manifests/backup.pp deleted file mode 100644 index 585621de90..0000000000 --- a/modules/mysql_backup/manifests/backup.pp +++ /dev/null @@ -1,54 +0,0 @@ -# == Define: mysql_backup::backup -# -# Arguments determine when backups should be taken, where they should -# be located, and how often they shouled be rotated. The namevar -# of the define must be the name of the database to backup. -# This define assumes that the mysqldump command is installed under -# /usr/bin. -# -define mysql_backup::backup ( - $minute = '0', - $hour = '0', - $day = '*', - $dest_dir = '/var/backups/mysql_backups', - $rotation = 'daily', - $num_backups = '30', - $defaults_file = '/etc/mysql/debian.cnf' -) { - # Wrap in check as there may be mutliple backup defines backing - # up to the same dir. - if ! defined(File[$dest_dir]) { - file { $dest_dir: - ensure => directory, - mode => '0755', - owner => 'root', - group => 'root', - } - } - - if ! defined(Package['mysql-client']) { - package { 'mysql-client': - ensure => present, - } - } - - cron { "${name}-backup": - ensure => present, - command => "/usr/bin/mysqldump --defaults-file=${defaults_file} --opt --ignore-table mysql.event --all-databases | gzip -9 > ${dest_dir}/${name}.sql.gz", - minute => $minute, - hour => $hour, - weekday => $day, - require => File[$dest_dir], - } - - include logrotate - logrotate::file { "${name}-rotate": - log => "${dest_dir}/${name}.sql.gz", - options => [ - 'nocompress', - "rotate ${num_backups}", - $rotation, - ], - require => Cron["${name}-backup"], - } -} diff --git a/modules/mysql_backup/manifests/backup_remote.pp b/modules/mysql_backup/manifests/backup_remote.pp deleted file mode 100644 index 257c363a10..0000000000 --- a/modules/mysql_backup/manifests/backup_remote.pp +++ /dev/null @@ -1,67 +0,0 @@ -# == Define: mysql_backup::backup_remote -# -# Arguments determine when backups should be taken, where they should -# be located, and how often they shouled be rotated. Additionally -# provide remote DB authentication details for that DB to be backed up. -# This define assumes that the mysqldump command is installed under -# /usr/bin. All reachable DBs and tables will be backed up. -# -define mysql_backup::backup_remote ( - $database_host, - $database_user, - $database_password, - $minute = '0', - $hour = '0', - $day = '*', - $dest_dir = '/var/backups/mysql_backups', - $rotation = 'daily', - $num_backups = '30' -) { - # Wrap in check as there may be mutliple backup defines backing - # up to the same dir. - if ! defined(File[$dest_dir]) { - file { $dest_dir: - ensure => directory, - mode => '0755', - owner => 'root', - group => 'root', - } - } - $defaults_file = "/root/.${name}_db.cnf" - file { $defaults_file: - ensure => present, - mode => '0400', - owner => 'root', - group => 'root', - content => template('mysql_backup/my.cnf.erb'), - } - - if ! defined(Package['mysql-client']) { - package { 'mysql-client': - ensure => present, - } - } - - cron { "${name}-backup": - ensure => present, - command => "/usr/bin/mysqldump --defaults-file=${defaults_file} --opt --ignore-table mysql.event --all-databases | gzip -9 > ${dest_dir}/${name}.sql.gz", - minute => $minute, - hour => $hour, - weekday => $day, - require => [ - File[$dest_dir], - File[$defaults_file], - ], - } - - include logrotate - logrotate::file { "${name}-rotate": - log => "${dest_dir}/${name}.sql.gz", - options => [ - 'nocompress', - "rotate ${num_backups}", - $rotation, - ], - require => Cron["${name}-backup"], - } -} diff --git a/modules/mysql_backup/templates/my.cnf.erb b/modules/mysql_backup/templates/my.cnf.erb deleted file mode 100644 index c168a7d194..0000000000 --- a/modules/mysql_backup/templates/my.cnf.erb +++ /dev/null @@ -1,4 +0,0 @@ -[client] -host=<%= database_host %> -user=<%= database_user %> -password=<%= database_password %>