aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2017-06-05 19:02:42 -0300
committerSilvio Rhatto <rhatto@riseup.net>2017-06-05 19:02:42 -0300
commita0cf3162460993ce01a4b6c6fcd520c14c958332 (patch)
tree87beb7bdcd31806dfd3b40ed646366d91cdbff85
parent554e7acae0878e44374f7ecaf3bae2e15e0a132d (diff)
downloadpuppet-backup-a0cf3162460993ce01a4b6c6fcd520c14c958332.tar.gz
puppet-backup-a0cf3162460993ce01a4b6c6fcd520c14c958332.tar.bz2
Changes for puppet 4 compatibility
-rw-r--r--manifests/duplicity.pp2
-rw-r--r--manifests/init.pp24
-rw-r--r--templates/duplicity.conf.erb10
3 files changed, 18 insertions, 18 deletions
diff --git a/manifests/duplicity.pp b/manifests/duplicity.pp
index 2da5db1..e84e050 100644
--- a/manifests/duplicity.pp
+++ b/manifests/duplicity.pp
@@ -35,7 +35,7 @@ define backup::duplicity(
content => template('backup/duplicity.conf.erb'),
owner => root,
group => root,
- mode => 0600,
+ mode => '0600',
require => File["${backupninja::configdir}"],
}
diff --git a/manifests/init.pp b/manifests/init.pp
index e272b56..421800f 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -60,21 +60,21 @@ class backup(
ensure => directory,
owner => root,
group => root,
- mode => 0755,
+ mode => '0755',
}
file { "/var/log/backup":
ensure => directory,
owner => root,
group => root,
- mode => 0755,
+ mode => '0755',
}
file { "/etc/logrotate.d/backup":
ensure => present,
owner => root,
group => root,
- mode => 0644,
+ mode => '0644',
source => "puppet:///modules/backup/logrotate.d/backup",
}
@@ -83,7 +83,7 @@ class backup(
content => template('backup/rdiff-check.sh.erb'),
owner => root,
group => root,
- mode => 0755,
+ mode => '0755',
ensure => present,
}
@@ -103,7 +103,7 @@ class backup(
content => template('backup/rsync-check.sh.erb'),
owner => root,
group => root,
- mode => 0755,
+ mode => '0755',
ensure => present,
}
@@ -127,7 +127,7 @@ class backup(
ensure => present,
owner => "root",
group => "root",
- mode => 0644,
+ mode => '0644',
source => "puppet:///modules/backup/handlers/rsync",
require => Package['backupninja'],
}
@@ -137,7 +137,7 @@ class backup(
file { "/usr/local/sbin/sync-backups":
owner => root,
group => root,
- mode => 0755,
+ mode => '0755',
ensure => absent,
}
@@ -146,7 +146,7 @@ class backup(
file { "/usr/local/sbin/sync-media":
owner => root,
group => root,
- mode => 0755,
+ mode => '0755',
ensure => absent,
}
@@ -155,7 +155,7 @@ class backup(
file { "/usr/local/sbin/sync-media-export":
owner => root,
group => root,
- mode => 0755,
+ mode => '0755',
ensure => absent,
}
@@ -164,7 +164,7 @@ class backup(
file { "/usr/local/sbin/sync-media-init":
owner => root,
group => root,
- mode => 0755,
+ mode => '0755',
ensure => absent,
}
@@ -173,7 +173,7 @@ class backup(
file { "/usr/local/sbin/sync-media-initremotes":
owner => root,
group => root,
- mode => 0755,
+ mode => '0755',
ensure => absent,
}
@@ -182,7 +182,7 @@ class backup(
file { "/usr/local/sbin/mount-media":
owner => root,
group => root,
- mode => 0755,
+ mode => '0755',
ensure => absent,
}
diff --git a/templates/duplicity.conf.erb b/templates/duplicity.conf.erb
index 3f2cf9e..846f9de 100644
--- a/templates/duplicity.conf.erb
+++ b/templates/duplicity.conf.erb
@@ -29,10 +29,10 @@ mkdir -p $BACKUP_FOLDER
# adds support for checking the existing backup
if [ "$1" == "--check" ]; then
- duplicity collection-status file:///$BACKUP_FOLDER
+ duplicity collection-status file:////$BACKUP_FOLDER
else
# cleanup any previous broken backups
- duplicity cleanup file:///$BACKUP_FOLDER --force
+ duplicity cleanup file:////$BACKUP_FOLDER --force
# remove dangling lockfiles
if [ -z "`pidof duplicity`" ]; then
@@ -43,14 +43,14 @@ else
# have greater precedence; see duplicity(1) for more info
duplicity -v6 --full-if-older-than $FULL_IF_OLDER_THAN \
--tempdir $TMP --encrypt-key $ENCRYPT_KEY --sign-key $SIGN_KEY \
- --exclude $TMP $EXCLUDE $INCLUDE --exclude '**' / file:///$BACKUP_FOLDER
+ --exclude $TMP $EXCLUDE $INCLUDE --exclude '**' / file:////$BACKUP_FOLDER
if [ "$?" != "0" ]; then
fatal "Duplicity backup failed."
fi
- duplicity remove-older-than $REMOVE_OLDER_THAN file:///$BACKUP_FOLDER --force || exit 1
- duplicity remove-all-but-n-full $REMOVE_ALL_BUT_N_FULL file:///$BACKUP_FOLDER --force || exit 1
+ duplicity remove-older-than $REMOVE_OLDER_THAN file:////$BACKUP_FOLDER --force || exit 1
+ duplicity remove-all-but-n-full $REMOVE_ALL_BUT_N_FULL file:////$BACKUP_FOLDER --force || exit 1
if [ "$?" != "0" ]; then
fatal "Removal of old backups failed."