}
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
}
}
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':
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),
# <name> <ip addresses> <key>
| 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,
}
# 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,
}
$sshkeys_sources = '/etc/dsa/postgresql-backup/sshkeys-sources'
$base_backup_clusters = '/etc/dsa/postgresql-backup/base-backup-clusters'
- $tag_base_backup = "postgresql::server::backup-source-make-base-backup-entry"
- $tag_source_sshkey = "postgresql::server::backup-source-sshkey"
- $tag_source_pgpassline = "postgresql::server::backup-source-pgpassline"
- $tag_dsa_check_backupp = "postgresql::server::backup-dsa-check-backuppg"
+ $tag_base_backup = 'postgresql::server::backup-source-make-base-backup-entry'
+ $tag_source_sshkey = 'postgresql::server::backup-source-sshkey'
+ $tag_source_pgpassline = 'postgresql::server::backup-source-pgpassline'
+ $tag_dsa_check_backupp = 'postgresql::server::backup-dsa-check-backuppg'
}
# @param pg_cluster cluster name
# @param pg_version pg version of the cluster
define postgres::backup_server::register_backup_cluster (
- String $hostname = $::hostname,
- String $fqdn = $::fqdn,
Integer $pg_port,
String $pg_role,
String $pg_password,
String $pg_cluster,
String $pg_version,
+ String $hostname = $::hostname,
+ String $fqdn = $::fqdn,
) {
include postgres::backup_server::globals
# foobar.debian.org:5432:*:debian-backup:swordfish
- @@concat::fragment { "postgresql::server::backup-source-pgpassline::$hostname::$pg_port::$pg_role":
- target => $postgres::backup_server::globals::pgpassfile,
+ @@concat::fragment { "postgresql::server::backup-source-pgpassline::${hostname}::${pg_port}::${pg_role}":
+ target => $postgres::backup_server::globals::pgpassfile,
content => @("EOF"),
${fqdn}:${pg_port}:*:${pg_role}:${pg_password}
| EOF
}
# example entry:
# vittoria.debian.org 5432 debian-backup main 9.6
- @@concat::fragment { "postgresql::server::backup-source-make-base-backup-entry::$hostname::$pg_port::$pg_role":
+ @@concat::fragment { "postgresql::server::backup-source-make-base-backup-entry::${hostname}::${pg_port}::${pg_role}":
tag => $postgres::backup_server::globals::tag_base_backup,
target => $postgres::backup_server::globals::base_backup_clusters,
content => "${::fqdn} ${pg_port} ${pg_role} ${pg_cluster} ${pg_version}",
${hostname}:
${pg_cluster}:
| EOF
- tag => $postgres::backup_server::globals::tag_dsa_check_backupp,
- notify => Exec['update dsa-check-backuppg-manual.conf']
+ tag => $postgres::backup_server::globals::tag_dsa_check_backupp,
+ notify => Exec['update dsa-check-backuppg-manual.conf']
}
}