From f33c5337fa7930357a56c1da27c063ee69c9f793 Mon Sep 17 00:00:00 2001 From: Mark Stosberg Date: Sat, 2 Mar 2024 07:27:03 -0500 Subject: [PATCH] Breaking change: autorestic_config is now YAML, not a string. This change allows Ansible or YAML linters to catch syntax errors in the structure. It also allows syntax highlighting to work. --- README.md | 3 +-- defaults/main.yml | 3 +-- tasks/main.yml | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 40b4d72..f6a5ff5 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ autorestic_restic_install_directory: The directories to install the autorestic and restic binaries at. ```yaml -autorestic_config: |- +autorestic_config: version: 2 locations: home: @@ -53,7 +53,6 @@ autorestic_config: |- to: remote # Every Monday cron: "0 0 * * MON" - backends: remote: type: b2 diff --git a/defaults/main.yml b/defaults/main.yml index 8a85acc..821cc0d 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -6,7 +6,7 @@ autorestic_install_directory: path: /opt/autorestic/bin autorestic_restic_install_directory: path: /opt/restic/bin -autorestic_config: |- +autorestic_config: version: 2 locations: home: @@ -14,7 +14,6 @@ autorestic_config: |- to: remote # Every Monday cron: "0 0 * * MON" - backends: remote: type: b2 diff --git a/tasks/main.yml b/tasks/main.yml index b14fd5a..5c9c708 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -47,7 +47,7 @@ - name: Create autorestic configuration file ansible.builtin.copy: - content: "{{ autorestic_config }}" + content: "{{ autorestic_config | to_yaml }}" dest: ~/.autorestic.yml mode: "0600"