summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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: