X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fpostgres%2Fmanifests%2Fbackup_source.pp;h=304e7d6cdd736fbdad4b4c2eeb3446273a0dc16e;hb=483ee60efd32db8ba0777e569fd72592cfee7bf6;hp=04a324d3b775190cc2411d46d957c4d2498c18f5;hpb=73fb938ab3d2a34960e3b0024d356ff226ccec0a;p=mirror%2Fdsa-puppet.git diff --git a/modules/postgres/manifests/backup_source.pp b/modules/postgres/manifests/backup_source.pp index 04a324d3b..304e7d6cd 100644 --- a/modules/postgres/manifests/backup_source.pp +++ b/modules/postgres/manifests/backup_source.pp @@ -2,56 +2,20 @@ # See dsa-wiki input/howto/postgres-backup.creole for some documentation # class postgres::backup_source { - file { "/usr/local/bin/pg-backup-file": - mode => '0555', - source => "puppet:///modules/roles/postgresql_server/pg-backup-file", - } - file { "/usr/local/bin/pg-receive-file-from-backup": - mode => '0555', - source => "puppet:///modules/roles/postgresql_server/pg-receive-file-from-backup", - } - file { "/etc/dsa/pg-backup-file.conf": - content => template('roles/postgresql_server/pg-backup-file.conf.erb'), - } + include postgres::backup_server::register_backup_clienthost - if ! $::postgresql_key { - exec { 'create-postgresql-key': - command => '/bin/su - postgres -c \'mkdir -p -m 02700 .ssh && ssh-keygen -C "`whoami`@`hostname` (`date +%Y-%m-%d`)" -P "" -f .ssh/id_rsa -q\'', - onlyif => '/usr/bin/getent passwd postgres > /dev/null && ! [ -e /var/lib/postgresql/.ssh/id_rsa ]' - } - } + file { '/usr/local/bin/pg-backup-file': + mode => '0555', + source => 'puppet:///modules/postgres/backup_source/pg-backup-file', + } + file { '/etc/dsa/pg-backup-file.conf': + content => template('postgres/backup_source/pg-backup-file.conf.erb'), + } + file { '/usr/local/bin/pg-receive-file-from-backup': + mode => '0555', + source => 'puppet:///modules/postgres/pg-receive-file-from-backup', + } - if $::hostname in [melartin, vittoria] { - postgres::backup_cluster { $::hostname: - pg_version => '9.6', - } - } - if $::hostname in [buxtehude] { - postgres::backup_cluster { $::hostname: - pg_version => '11', - pg_port => 5433, - } - postgres::backup_cluster { "${::hostname}-debbugs": - pg_version => '11', - pg_port => 5441, - pg_cluster => 'debbugs', - } - } - if $::hostname in [danzi] { - postgres::backup_cluster { $::hostname: - pg_version => '9.6', - pg_port => 5433, - } - postgres::backup_cluster { "${::hostname}-debconf": - pg_version => '9.6', - pg_port => 5434, - pg_cluster => 'debconf', - } - } - - if $::hostname in [melartin, vittoria, godard, buxtehude, danzi] { - postgres::backup_server::register_backup_clienthost { "backup-clienthost-${::fqdn}}": - } - } + ssh::keygen {'postgres': } }