X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fpostgres%2Fmanifests%2Fbackup_server.pp;h=1f95f3eb8ecfc253c40003e7f6d28c442ccd5040;hb=06b5ef2cf5af685b2e35f80bc108e0d5d21b0add;hp=0da5594afd34b4fe59e5c797a7f4e7493a51c82e;hpb=0c17090552d7b68ae9ddf4a6a270159489f80070;p=mirror%2Fdsa-puppet.git diff --git a/modules/postgres/manifests/backup_server.pp b/modules/postgres/manifests/backup_server.pp index 0da5594af..1f95f3eb8 100644 --- a/modules/postgres/manifests/backup_server.pp +++ b/modules/postgres/manifests/backup_server.pp @@ -21,18 +21,18 @@ class postgres::backup_server { } Concat::Fragment <<| tag == $postgres::backup_server::globals::tag_base_backup |>> - file { '/usr/local/bin/postgres-make-base-backups': + file { $postgres::backup_server::globals::make_base_backups: mode => '0555', content => template('postgres/backup_server/postgres-make-base-backups.erb'), } file { '/var/lib/dsa/postgres-make-base-backups': ensure => directory, - owner => 'debbackup', - mode => '0755', + owner => 'debbackup', + mode => '0755', } concat::fragment { 'puppet-crontab--postgres-make_base_backups': - target => '/etc/cron.d/puppet-crontab', - content => @("EOF") + target => '/etc/cron.d/puppet-crontab', + content => @("EOF") */30 * * * * debbackup sleep $(( RANDOM \% 1200 )); chronic ${$postgres::backup_server::globals::make_base_backups} | EOF } @@ -47,11 +47,11 @@ class postgres::backup_server { } file { '/usr/local/bin/postgres-make-backup-sshauthkeys': content => template('postgres/backup_server/postgres-make-backup-sshauthkeys.erb'), - mode => '0555', + 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', + source => 'puppet:///modules/postgres/backup_server/postgres-make-one-base-backup', mode => '0555' } file { '/etc/dsa/postgresql-backup/sshkeys-manual': @@ -59,18 +59,18 @@ class postgres::backup_server { notify => Exec['postgres-make-backup-sshauthkeys'], } concat { $postgres::backup_server::globals::sshkeys_sources: - notify => Exec['postgres-make-backup-sshauthkeys'], + notify => Exec['postgres-make-backup-sshauthkeys'], } concat::fragment { 'postgresql-backup/source-sshkeys-header': - target => $postgres::backup_server::globals::sshkeys_sources , - content => @(EOF), + target => $postgres::backup_server::globals::sshkeys_sources , + content => @(EOF), # | EOF - order => '00', + order => '00', } Concat::Fragment <<| tag == $postgres::backup_server::globals::tag_source_sshkey |>> - exec { "postgres-make-backup-sshauthkeys": - command => "/usr/local/bin/postgres-make-backup-sshauthkeys", + exec { 'postgres-make-backup-sshauthkeys': + command => '/usr/local/bin/postgres-make-backup-sshauthkeys', refreshonly => true, } @@ -78,23 +78,22 @@ class postgres::backup_server { # Maintain /etc/nagios/dsa-check-backuppg.conf # file { '/etc/dsa/postgresql-backup/dsa-check-backuppg.conf.d': - ensure => 'directory', + ensure => 'directory', purge => true, force => true, recurse => true, - source => 'puppet:///files/empty/', - notify => Exec['update dsa-check-backuppg-manual.conf'], + notify => Exec['update dsa-check-backuppg-manual.conf'], } file { '/etc/dsa/postgresql-backup/dsa-check-backuppg.conf.d/manual.conf': content => template('postgres/backup_server/dsa-check-backuppg-manual.conf.erb'), - notify => Exec['update dsa-check-backuppg-manual.conf'] + notify => Exec['update dsa-check-backuppg-manual.conf'] } File<<| tag == $postgres::backup_server::globals::tag_dsa_check_backupp |>> - exec { "update dsa-check-backuppg-manual.conf": - command => @(EOF), + exec { 'update dsa-check-backuppg-manual.conf': + command => @(EOF), perl -MYAML=LoadFile,Dump -MHash::Merge::Simple=merge -E 'say Dump(merge(map{LoadFile($_)}@ARGV))' /etc/dsa/postgresql-backup/dsa-check-backuppg.conf.d/*.conf > /etc/nagios/dsa-check-backuppg.conf | EOF - provider => shell, + provider => shell, refreshonly => true, }