X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fpostgres%2Fmanifests%2Fbackup_server.pp;h=a5361b1e1cd52080914fc826ab7a881adb8ecc9e;hb=d72d73ccae39e018592248314119b22994520e29;hp=653b5f88dfae742d212bd4267b36d62d9a712197;hpb=ac0e969325e7928b585284c42956d6579f646972;p=mirror%2Fdsa-puppet.git diff --git a/modules/postgres/manifests/backup_server.pp b/modules/postgres/manifests/backup_server.pp index 653b5f88d..a5361b1e1 100644 --- a/modules/postgres/manifests/backup_server.pp +++ b/modules/postgres/manifests/backup_server.pp @@ -36,14 +36,17 @@ class postgres::backup_server { | EOTEMPLATE order => '99', } - if $::hostname in [backuphost] { - file { '/etc/cron.d/puppet-postgres-make-base-backups': - content => "20 1 * * 0 debbackup chronic ${$postgres::backup_server::globals::make_base_backups}\n", - } - } else { - file { '/etc/cron.d/puppet-postgres-make-base-backups': - content => "20 0 * * 6 debbackup chronic ${$postgres::backup_server::globals::make_base_backups}\n", - } + file { '/etc/cron.d/puppet-postgres-make-base-backups': ensure => absent; } + file { '/var/lib/dsa/postgres-make-base-backups': + ensure => directory, + owner => 'debbackup', + mode => '0755', + } + concat::fragment { 'dsa-puppet-stuff--postgres-make_base_backups': + target => '/etc/cron.d/dsa-puppet-stuff', + content => @("EOF") + */30 * * * * debbackup sleep $(( RANDOM \% 1200 )); chronic ${$postgres::backup_server::globals::make_base_backups} + | EOF } #### @@ -59,6 +62,10 @@ class postgres::backup_server { mode => '0555', notify => Exec['postgres-make-backup-sshauthkeys'], } + file { '/usr/local/bin/postgres-make-one-base-backup': + source => 'puppet:///modules/postgres/backup_server/postgres-make-one-base-backup', + mode => '0555' + } file { '/etc/dsa/postgresql-backup/sshkeys-manual': content => template('postgres/backup_server/sshkeys-manual.erb'), notify => Exec['postgres-make-backup-sshauthkeys'], @@ -95,16 +102,7 @@ class postgres::backup_server { notify => Exec['update dsa-check-backuppg-manual.conf'] } file { '/etc/dsa/postgresql-backup/dsa-check-backuppg.conf.d/moszumanska.conf': - ensure => ($::hostname in [backuphost]) ? { - true => 'absent', - default => 'present' - }, - content => @(EOF), - --- - backups: - moszumanska: - main: - | EOF + ensure => 'absent', notify => Exec['update dsa-check-backuppg-manual.conf'] } File<<| tag == $postgres::backup_server::globals::tag_dsa_check_backupp |>>