pgsql.pp 1021 Bytes
Newer Older
Jamie McClelland's avatar
Jamie McClelland committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
# Safe PGSQL dumps, as part of a backupninja run.
#
# Valid attributes for this type are:
#
#   order: The prefix to give to the handler config filename, to set
#      order in which the actions are executed during the backup run.
#
#   ensure: Allows you to delete an entry if you don't want it any more
#      (but be sure to keep the configdir, name, and order the same, so
#      that we can find the correct file to remove).
#
#   backupdir, compress, configfile: As defined in the
#   backupninja documentation, with the caveat that hotcopy, sqldump,
#   and compress take true/false rather than yes/no.
# 
define backupninja::pgsql(
17
  $order = 10, $ensure = present, $databases = 'all', $backupdir = "/var/backups/postgres", $compress = true, $vsname = false)
Jamie McClelland's avatar
Jamie McClelland committed
18
{
19
  file { "${backupninja::configdir}/${order}_${name}.pgsql":
Jamie McClelland's avatar
Jamie McClelland committed
20 21 22 23
    ensure => $ensure,
    content => template('backupninja/pgsql.conf.erb'),
    owner => root,
    group => root,
24
    mode => '0600',
25
    require => File["${backupninja::configdir}"]
Jamie McClelland's avatar
Jamie McClelland committed
26 27
  }
}