diff --git a/.gitignore b/.gitignore index 496ee2c..3bbb019 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -.DS_Store \ No newline at end of file +.cache +.DS_Store diff --git a/README.md b/README.md index 9715cf6..b8c039f 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,7 @@ restic_archiver__repos: {} # keep_monthly: 1 # keep_yearly: 1 # keep_within: 1 +# prune: true # how long should we store all backups by default restic_archiver__keep: 5 @@ -84,4 +85,5 @@ submodules_versioncheck: false restic_archiver__cache_config: false restic_archiver__cache_dir: '~/.cache/restic' +restic_archiver__prune: false ``` diff --git a/defaults/main.yml b/defaults/main.yml index eee40d8..fc257c0 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -18,6 +18,7 @@ restic_archiver__repos: {} # keep_monthly: 1 # keep_yearly: 1 # keep_within: 1 +# prune: true # how long should we store all backups by default restic_archiver__keep: 5 @@ -63,3 +64,5 @@ submodules_versioncheck: false restic_archiver__cache_config: false restic_archiver__cache_dir: '~/.cache/restic' + +restic_archiver__prune: false diff --git a/meta/main.yml b/meta/main.yml index e775f4a..6c100b4 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -2,6 +2,7 @@ galaxy_info: role_name: restic author: L3D + namespace: do1jlr description: Role to deploy restic and setup backups. license: MIT min_ansible_version: 2.11 diff --git a/templates/restic_forget_snapshots.j2 b/templates/restic_forget_snapshots.j2 index fc9c6af..53c1be7 100644 --- a/templates/restic_forget_snapshots.j2 +++ b/templates/restic_forget_snapshots.j2 @@ -72,7 +72,7 @@ EOT {%- endif -%} {% if repo.keep_within is defined and repo.keep_within != None %} \ --keep-within {{ repo.keep_within }} {% endif -%} - {%- if repo.prune|default(false) %} \ + {%- if repo.prune|default(restic_archiver__prune) %} \ --prune {% endif %} {%- endmacro %} diff --git a/vars/main.yml b/vars/main.yml index 73731df..90d20c8 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -1,3 +1,3 @@ --- -playbook_version_number: 44 # should be int +playbook_version_number: 45 # should be int playbook_version_path: 'role-restic_archiver_roles-ansible_github.com.version'