diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-05-28 10:32:51 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-05-28 10:46:41 +0200 |
commit | 33d0c69450127732c7105145b5e587811ffd644b (patch) | |
tree | 2e142305fbbfd7ece51ffb29f6fe2164ee6934e5 /modules/profile/manifests/postgresql | |
parent | 83341b3ca1ef7dbba1afaea41a722b43e50bdb5b (diff) | |
download | Puppet-33d0c69450127732c7105145b5e587811ffd644b.tar.gz Puppet-33d0c69450127732c7105145b5e587811ffd644b.tar.zst Puppet-33d0c69450127732c7105145b5e587811ffd644b.zip |
Pause replication before the postgresql backup
Diffstat (limited to 'modules/profile/manifests/postgresql')
-rw-r--r-- | modules/profile/manifests/postgresql/backup_dump.pp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/modules/profile/manifests/postgresql/backup_dump.pp b/modules/profile/manifests/postgresql/backup_dump.pp index 7578027..cae20f7 100644 --- a/modules/profile/manifests/postgresql/backup_dump.pp +++ b/modules/profile/manifests/postgresql/backup_dump.pp | |||
@@ -30,13 +30,18 @@ define profile::postgresql::backup_dump ( | |||
30 | $pg_port_arg = "" | 30 | $pg_port_arg = "" |
31 | } | 31 | } |
32 | 32 | ||
33 | file { "/usr/local/sbin/backup_psql_$pg_host.sh": | ||
34 | mode => "0755", | ||
35 | content => template("profile/postgresql/backup_psql.sh.erb"), | ||
36 | } | ||
37 | |||
33 | if ($pg_host == "eldiron.immae.eu") { | 38 | if ($pg_host == "eldiron.immae.eu") { |
34 | cron::job::multiple { "backup_psql_$pg_host": | 39 | cron::job::multiple { "backup_psql_$pg_host": |
35 | ensure => "present", | 40 | ensure => "present", |
36 | require => [File[$pg_backup_path], File[$pg_path]], | 41 | require => [File[$pg_backup_path], File[$pg_path]], |
37 | jobs => [ | 42 | jobs => [ |
38 | { | 43 | { |
39 | command => "/usr/bin/pg_dumpall -h $pg_path$pg_port_arg -f $pg_backup_path/\$(date -Iseconds).sql", | 44 | command => "/usr/local/sbin/backup_psql_$pg_host.sh", |
40 | user => $pg_user, | 45 | user => $pg_user, |
41 | hour => "22,4,10,16", | 46 | hour => "22,4,10,16", |
42 | minute => 0, | 47 | minute => 0, |
@@ -57,7 +62,7 @@ define profile::postgresql::backup_dump ( | |||
57 | require => [File[$pg_backup_path], File[$pg_path]], | 62 | require => [File[$pg_backup_path], File[$pg_path]], |
58 | jobs => [ | 63 | jobs => [ |
59 | { | 64 | { |
60 | command => "/usr/bin/pg_dumpall -h $pg_path$pg_port_arg -f $pg_backup_path/\$(date -Iseconds).sql", | 65 | command => "/usr/local/sbin/backup_psql_$pg_host.sh", |
61 | user => $pg_user, | 66 | user => $pg_user, |
62 | hour => "22,4,10,16", | 67 | hour => "22,4,10,16", |
63 | minute => 0, | 68 | minute => 0, |