From: Peter Palfrader Date: Wed, 4 Sep 2019 12:48:36 +0000 (+0200) Subject: whitespace change only -- replace tabs with 2 spaces X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=b07d4828f3f22e9f4c80709ce2948174f9c1124f;p=mirror%2Fdsa-puppet.git whitespace change only -- replace tabs with 2 spaces --- diff --git a/modules/postgres/manifests/backup_server.pp b/modules/postgres/manifests/backup_server.pp index aab56bf80..11eae6af3 100644 --- a/modules/postgres/manifests/backup_server.pp +++ b/modules/postgres/manifests/backup_server.pp @@ -1,116 +1,116 @@ # class postgres::backup_server { - include postgres::backup_server::globals + include postgres::backup_server::globals - #### - # Regularly pull base backups - # - ensure_packages ( "postgresql-client-9.6", { ensure => 'installed' }) + #### + # Regularly pull base backups + # + ensure_packages ( "postgresql-client-9.6", { ensure => 'installed' }) - concat { $postgres::backup_server::globals::make_base_backups: - mode => '0555', - } - concat::fragment { 'make-base-backups-header': - target => $postgres::backup_server::globals::make_base_backups, - content => template('postgres/backup_server/postgres-make-base-backups.erb'), - order => '00', - } - Concat::Fragment <<| tag == $postgres::backup_server::globals::tag_base_backup |>> - concat::fragment { 'make-base-backups-tail': - target => $postgres::backup_server::globals::make_base_backups, - content => @(EOTEMPLATE), - # EOF by make-base-backups-tail fragment - EOF - | EOTEMPLATE - order => '99', - } - 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 - } + concat { $postgres::backup_server::globals::make_base_backups: + mode => '0555', + } + concat::fragment { 'make-base-backups-header': + target => $postgres::backup_server::globals::make_base_backups, + content => template('postgres/backup_server/postgres-make-base-backups.erb'), + order => '00', + } + Concat::Fragment <<| tag == $postgres::backup_server::globals::tag_base_backup |>> + concat::fragment { 'make-base-backups-tail': + target => $postgres::backup_server::globals::make_base_backups, + content => @(EOTEMPLATE), + # EOF by make-base-backups-tail fragment + EOF + | EOTEMPLATE + order => '99', + } + 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 + } - #### - # Maintain authorized_keys file on backup servers for WAL shipping - # - # do not let other hosts directly build our authorized_keys file, - # instead go via a script that somewhat validates intput - file { '/etc/dsa/postgresql-backup': - ensure => 'directory', - } - file { '/usr/local/bin/postgres-make-backup-sshauthkeys': - content => template('postgres/backup_server/postgres-make-backup-sshauthkeys.erb'), - 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'], - } - concat { $postgres::backup_server::globals::sshkeys_sources: - notify => Exec['postgres-make-backup-sshauthkeys'], - } - concat::fragment { 'postgresql-backup/source-sshkeys-header': - target => $postgres::backup_server::globals::sshkeys_sources , - content => @(EOF), - # - | EOF - 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", - refreshonly => true, - } + #### + # Maintain authorized_keys file on backup servers for WAL shipping + # + # do not let other hosts directly build our authorized_keys file, + # instead go via a script that somewhat validates intput + file { '/etc/dsa/postgresql-backup': + ensure => 'directory', + } + file { '/usr/local/bin/postgres-make-backup-sshauthkeys': + content => template('postgres/backup_server/postgres-make-backup-sshauthkeys.erb'), + 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'], + } + concat { $postgres::backup_server::globals::sshkeys_sources: + notify => Exec['postgres-make-backup-sshauthkeys'], + } + concat::fragment { 'postgresql-backup/source-sshkeys-header': + target => $postgres::backup_server::globals::sshkeys_sources , + content => @(EOF), + # + | EOF + 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", + refreshonly => true, + } - #### - # Maintain /etc/nagios/dsa-check-backuppg.conf - # - file { '/etc/dsa/postgresql-backup/dsa-check-backuppg.conf.d': - ensure => 'directory', - purge => true, - force => true, - recurse => true, - source => 'puppet:///files/empty/', - 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'] - } - File<<| tag == $postgres::backup_server::globals::tag_dsa_check_backupp |>> - ensure_packages ( "libhash-merge-simple-perl", { ensure => 'installed' }) - 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, - refreshonly => true, - } + #### + # Maintain /etc/nagios/dsa-check-backuppg.conf + # + file { '/etc/dsa/postgresql-backup/dsa-check-backuppg.conf.d': + ensure => 'directory', + purge => true, + force => true, + recurse => true, + source => 'puppet:///files/empty/', + 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'] + } + File<<| tag == $postgres::backup_server::globals::tag_dsa_check_backupp |>> + ensure_packages ( "libhash-merge-simple-perl", { ensure => 'installed' }) + 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, + refreshonly => true, + } - #### - # Maintain .pgpass file on backup servers - # # - concat { $postgres::backup_server::globals::pgpassfile: - owner => 'debbackup', - group => 'debbackup', - mode => '0400' - } - concat::fragment{ 'pgpass-local': - target => $postgres::backup_server::globals::pgpassfile, - source => '/home/debbackup/.pgpass-local', - order => '00' - } - Concat::Fragment <<| tag == $postgres::backup_server::globals::tag_source_pgpassline |>> + #### + # Maintain .pgpass file on backup servers + # # + concat { $postgres::backup_server::globals::pgpassfile: + owner => 'debbackup', + group => 'debbackup', + mode => '0400' + } + concat::fragment{ 'pgpass-local': + target => $postgres::backup_server::globals::pgpassfile, + source => '/home/debbackup/.pgpass-local', + order => '00' + } + Concat::Fragment <<| tag == $postgres::backup_server::globals::tag_source_pgpassline |>> } diff --git a/modules/postgres/manifests/backup_server/globals.pp b/modules/postgres/manifests/backup_server/globals.pp index f89a368f1..550450487 100644 --- a/modules/postgres/manifests/backup_server/globals.pp +++ b/modules/postgres/manifests/backup_server/globals.pp @@ -1,11 +1,11 @@ # class postgres::backup_server::globals { - $make_base_backups = '/usr/local/bin/postgres-make-base-backups' - $pgpassfile = '/home/debbackup/.pgpass' - $sshkeys_sources = '/etc/dsa/postgresql-backup/sshkeys-sources' + $make_base_backups = '/usr/local/bin/postgres-make-base-backups' + $pgpassfile = '/home/debbackup/.pgpass' + $sshkeys_sources = '/etc/dsa/postgresql-backup/sshkeys-sources' - $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" } diff --git a/modules/postgres/manifests/backup_server/register_backup_clienthost.pp b/modules/postgres/manifests/backup_server/register_backup_clienthost.pp index 00ef58288..e6c27d199 100644 --- a/modules/postgres/manifests/backup_server/register_backup_clienthost.pp +++ b/modules/postgres/manifests/backup_server/register_backup_clienthost.pp @@ -1,19 +1,19 @@ # define postgres::backup_server::register_backup_clienthost ( - $sshpubkey = $::postgresql_key, - $ipaddrlist = join(getfromhash($site::nodeinfo, 'ldap', 'ipHostNumber'), ","), - $hostname = $::hostname, + $sshpubkey = $::postgresql_key, + $ipaddrlist = join(getfromhash($site::nodeinfo, 'ldap', 'ipHostNumber'), ","), + $hostname = $::hostname, ) { - include postgres::backup_server::globals + include postgres::backup_server::globals - if $sshpubkey { - $addr = assert_type(String[1], $ipaddrlist) - @@concat::fragment { "postgresql::server::backup-source-clienthost::$name::$fqdn": - target => $postgres::backup_server::globals::sshkeys_sources , - content => @("EOF"), - ${hostname} ${addr} ${sshpubkey} - | EOF - tag => $postgres::backup_server::globals::tag_source_sshkey, - } - } + if $sshpubkey { + $addr = assert_type(String[1], $ipaddrlist) + @@concat::fragment { "postgresql::server::backup-source-clienthost::$name::$fqdn": + target => $postgres::backup_server::globals::sshkeys_sources , + content => @("EOF"), + ${hostname} ${addr} ${sshpubkey} + | EOF + tag => $postgres::backup_server::globals::tag_source_sshkey, + } + } } diff --git a/modules/postgres/manifests/backup_server/register_backup_cluster.pp b/modules/postgres/manifests/backup_server/register_backup_cluster.pp index 12f01dfb2..0fd482cdb 100644 --- a/modules/postgres/manifests/backup_server/register_backup_cluster.pp +++ b/modules/postgres/manifests/backup_server/register_backup_cluster.pp @@ -1,41 +1,41 @@ # define postgres::backup_server::register_backup_cluster ( - $hostname = $::hostname, - $fqdn = $::fqdn, - $pg_port, - $pg_role, - $pg_password, - $pg_cluster, - $pg_version, + $hostname = $::hostname, + $fqdn = $::fqdn, + $pg_port, + $pg_role, + $pg_password, + $pg_cluster, + $pg_version, ) { - include postgres::backup_server::globals + 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, - content => @("EOF"), - ${fqdn}:${pg_port}:*:${pg_role}:${pg_password} - | EOF - tag => $postgres::backup_server::globals::tag_source_pgpassline, - } - # - # vittoria.debian.org 5432 debian-backup main 9.6 - @@concat::fragment { "postgresql::server::backup-source-make-base-backup-entry::$hostname::$pg_port::$pg_role": - target => $postgres::backup_server::globals::make_base_backups, - content => @("EOF"), - ${fqdn} ${pg_port} ${pg_role} ${pg_cluster} ${pg_version} - | EOF - tag => $postgres::backup_server::globals::tag_base_backup, - } + # 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, + content => @("EOF"), + ${fqdn}:${pg_port}:*:${pg_role}:${pg_password} + | EOF + tag => $postgres::backup_server::globals::tag_source_pgpassline, + } + # + # vittoria.debian.org 5432 debian-backup main 9.6 + @@concat::fragment { "postgresql::server::backup-source-make-base-backup-entry::$hostname::$pg_port::$pg_role": + target => $postgres::backup_server::globals::make_base_backups, + content => @("EOF"), + ${fqdn} ${pg_port} ${pg_role} ${pg_cluster} ${pg_version} + | EOF + tag => $postgres::backup_server::globals::tag_base_backup, + } - @@file { "/etc/dsa/postgresql-backup/dsa-check-backuppg.conf.d/${hostname}-${pg_cluster}.conf": - content => @("EOF"), - --- - backups: - ${hostname}: - ${pg_cluster}: - | EOF - tag => $postgres::backup_server::globals::tag_dsa_check_backupp, - notify => Exec['update dsa-check-backuppg-manual.conf'] - } + @@file { "/etc/dsa/postgresql-backup/dsa-check-backuppg.conf.d/${hostname}-${pg_cluster}.conf": + content => @("EOF"), + --- + backups: + ${hostname}: + ${pg_cluster}: + | EOF + tag => $postgres::backup_server::globals::tag_dsa_check_backupp, + notify => Exec['update dsa-check-backuppg-manual.conf'] + } }