diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2018-06-28 13:22:56 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2018-06-28 13:22:56 +0200 |
commit | 58cbf805bef1e0398a9a61249e313beec1c3b73c (patch) | |
tree | 70d16fe4702767da332bfed13b8287339a1bf943 /modules/profile/manifests/postgresql/backup_dump.pp | |
parent | 85c0bf0d262633f4a153b5662472cc0ed20d41ae (diff) | |
parent | ffcffbcb52dad28d28a0d36c989182e0716edd53 (diff) | |
download | Puppet-58cbf805bef1e0398a9a61249e313beec1c3b73c.tar.gz Puppet-58cbf805bef1e0398a9a61249e313beec1c3b73c.tar.zst Puppet-58cbf805bef1e0398a9a61249e313beec1c3b73c.zip |
Merge branch 'dev'
Diffstat (limited to 'modules/profile/manifests/postgresql/backup_dump.pp')
-rw-r--r-- | modules/profile/manifests/postgresql/backup_dump.pp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/modules/profile/manifests/postgresql/backup_dump.pp b/modules/profile/manifests/postgresql/backup_dump.pp index 10e349a..53fb20e 100644 --- a/modules/profile/manifests/postgresql/backup_dump.pp +++ b/modules/profile/manifests/postgresql/backup_dump.pp | |||
@@ -1,6 +1,7 @@ | |||
1 | define profile::postgresql::backup_dump ( | 1 | define profile::postgresql::backup_dump ( |
2 | String $pg_user = "postgres", | 2 | String $pg_user = "postgres", |
3 | String $pg_group = "postgres", | 3 | String $pg_group = "postgres", |
4 | Optional[Variant[String, Integer]] $pg_port = undef, | ||
4 | ) { | 5 | ) { |
5 | $base_path = $title | 6 | $base_path = $title |
6 | $pg_path = "$base_path/postgresql" | 7 | $pg_path = "$base_path/postgresql" |
@@ -23,12 +24,18 @@ define profile::postgresql::backup_dump ( | |||
23 | require => File[$base_path], | 24 | require => File[$base_path], |
24 | } | 25 | } |
25 | 26 | ||
27 | if $pg_port and !empty($pg_port) { | ||
28 | $pg_port_arg = " -p $pg_port" | ||
29 | } else { | ||
30 | $pg_port_arg = "" | ||
31 | } | ||
32 | |||
26 | cron::job::multiple { "backup_psql_$pg_host": | 33 | cron::job::multiple { "backup_psql_$pg_host": |
27 | ensure => "present", | 34 | ensure => "present", |
28 | require => [File[$pg_backup_path], File[$pg_path]], | 35 | require => [File[$pg_backup_path], File[$pg_path]], |
29 | jobs => [ | 36 | jobs => [ |
30 | { | 37 | { |
31 | command => "/usr/bin/pg_dumpall -h $pg_path -f $pg_backup_path/\$(date -Iseconds).sql", | 38 | command => "/usr/bin/pg_dumpall -h $pg_path$pg_port_arg -f $pg_backup_path/\$(date -Iseconds).sql", |
32 | user => $pg_user, | 39 | user => $pg_user, |
33 | hour => "22,4,10,16", | 40 | hour => "22,4,10,16", |
34 | minute => 0, | 41 | minute => 0, |