Skip to content

Commit

Permalink
Breaking change: autorestic_config is now YAML, not a string.
Browse files Browse the repository at this point in the history
This change allows Ansible or YAML linters to catch syntax errors in the
structure.

It also allows syntax highlighting to work.
  • Loading branch information
markstos committed Mar 2, 2024
1 parent 7595f3d commit f33c533
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,14 @@ autorestic_restic_install_directory:
The directories to install the autorestic and restic binaries at.

```yaml
autorestic_config: |-
autorestic_config:
version: 2
locations:
home:
from: /home/me
to: remote
# Every Monday
cron: "0 0 * * MON"
backends:
remote:
type: b2
Expand Down
3 changes: 1 addition & 2 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@ autorestic_install_directory:
path: /opt/autorestic/bin
autorestic_restic_install_directory:
path: /opt/restic/bin
autorestic_config: |-
autorestic_config:
version: 2
locations:
home:
from: /home/me
to: remote
# Every Monday
cron: "0 0 * * MON"
backends:
remote:
type: b2
Expand Down
2 changes: 1 addition & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit f33c533

Please sign in to comment.