summaryrefslogtreecommitdiffstats
path: root/modules/borgmatic
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2021-03-25 21:26:53 -0400
committerJesse Luehrs <doy@tozt.net>2021-03-25 21:26:53 -0400
commit1054f0b3baed82387bb7546aa79aaf5529e2727f (patch)
treeb50db08c50ae94907b3c3aa07816953f245eddb7 /modules/borgmatic
parent8ad16ab0761adb05441e8f9e8dcb46add1718498 (diff)
downloadpuppet-tozt-1054f0b3baed82387bb7546aa79aaf5529e2727f.tar.gz
puppet-tozt-1054f0b3baed82387bb7546aa79aaf5529e2727f.zip
fix passphrase escaping
Diffstat (limited to 'modules/borgmatic')
-rw-r--r--modules/borgmatic/manifests/init.pp2
-rw-r--r--modules/borgmatic/templates/config.yaml2
2 files changed, 2 insertions, 2 deletions
diff --git a/modules/borgmatic/manifests/init.pp b/modules/borgmatic/manifests/init.pp
index ed9022b..44a472c 100644
--- a/modules/borgmatic/manifests/init.pp
+++ b/modules/borgmatic/manifests/init.pp
@@ -5,7 +5,7 @@ class borgmatic($host = 'partofme.algo', $extra_paths = []) {
$current_hostname = "${facts['networking']['hostname']}"
$borgmatic_host = $host
- $borgmatic_passphrase = secret::value('borgmatic_passphrase')
+ $escaped_borgmatic_passphrase = regsubst(secret::value('borgmatic_passphrase'), "'", "''", 'G')
file {
"/etc/borgmatic":
ensure => directory;
diff --git a/modules/borgmatic/templates/config.yaml b/modules/borgmatic/templates/config.yaml
index 54a5634..bb4d1da 100644
--- a/modules/borgmatic/templates/config.yaml
+++ b/modules/borgmatic/templates/config.yaml
@@ -18,7 +18,7 @@ location:
- /home/doy/tmp
storage:
- encryption_passphrase: "<%= @borgmatic_passphrase %>"
+ encryption_passphrase: '<%= @escaped_borgmatic_passphrase %>'
ssh_command: /usr/bin/ssh -i /etc/borgmatic/borg_ssh_key -o StrictHostKeyChecking=no
retention: