Files
Matthew Stobbs 01239701f9 add restic
- fix packages that were broken
- change the way configuration is done
  - define default facts for packages with os_family level vars
  - refine the default facts into an os_family specfic config
2026-04-18 18:44:18 -06:00

44 lines
1.3 KiB
YAML

# vim: set filetype=yaml.ansible :
#
## Package: restic
## Description: backup with builtin encryption and compression
## Version: system
## Methods: system
## Helpers: -
---
- name: Set restic default facts # {{{
ansible.builtin.set_fact:
restic:
methods:
default: [system]
pkgname:
default: restic
- name: Finalise restic default facts
ansible.builtin.set_fact:
restic:
methods: "{{ restic.methods[os_family] | default(restic.methods.default) }}"
pkgname: "{{ restic.pkgname[os_family] | default(restic.pkgname.default) }}"
# }}}
- name: Configure restic
when:
- "'restic' not in __configured"
block:
- name: Set restic install method
when:
- restic_imethod is undefined
ansible.builtin.set_fact:
restic_imethod: "{{ imethod if imethod in restic.methods else restic.methods[0] }}"
- name: Configure restic system install
when:
- restic_imethod == 'system'
block:
- name: Queue restic system install
ansible.builtin.set_fact:
pkg_sys: "{{ pkg_sys + [restic.pkgname] }}"
restic_install: "{{ restic_imethod }}={{ restic.pkgname }}"
- name: Finalise restic configuration
ansible.builtin.set_fact:
__configured: "{{ __configured | combine( { 'restic': restic_install } ) }}"