Feat: basic borgmatic role
This commit is contained in:
@@ -2,10 +2,24 @@
|
||||
- name: Converge
|
||||
hosts: all
|
||||
become: yes
|
||||
vars:
|
||||
- borg_source_directories:
|
||||
- /media/test1/
|
||||
- /media/test2/
|
||||
- borg_repository:
|
||||
- /backup/
|
||||
- borgmatic_config_name: config.yaml
|
||||
|
||||
pre_tasks:
|
||||
- name: Update apt cache
|
||||
apt:
|
||||
update_cache: yes
|
||||
#- name: Update apt cache
|
||||
# apt:
|
||||
# update_cache: yes
|
||||
|
||||
- name: Create sources directories
|
||||
file:
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
with_items: "{{ borg_source_directories + borg_repository}}"
|
||||
|
||||
tasks:
|
||||
- name: "Include borgmatic"
|
||||
|
||||
@@ -9,6 +9,7 @@ platforms:
|
||||
- name: Debian
|
||||
box: "debian/bullseye64"
|
||||
pre_build_image: true
|
||||
|
||||
provisioner:
|
||||
name: ansible
|
||||
verifier:
|
||||
|
||||
@@ -6,3 +6,9 @@ def test_installed_packages(host):
|
||||
assert borgbackup.is_installed
|
||||
borgmatic = host.package("borgmatic")
|
||||
assert borgmatic.is_installed
|
||||
|
||||
def test_borgmatic_config(host):
|
||||
config = host.file("/etc/borgmatic/config.yaml")
|
||||
assert config.exists
|
||||
valid_config = host.run("sudo validate-borgmatic-config")
|
||||
assert valid_config.succeeded
|
||||
|
||||
Reference in New Issue
Block a user