diff --git a/group_vars/mash_servers b/group_vars/mash_servers index 1d52077..3cb824c 100644 --- a/group_vars/mash_servers +++ b/group_vars/mash_servers @@ -594,6 +594,69 @@ authentik_container_labels_traefik_tls_certResolver: "{{ devture_traefik_certRes +######################################################################## +# # +# backup-borg # +# # +######################################################################## + +backup_borg_enabled: false + +backup_borg_identifier: "{{ mash_playbook_service_identifier_prefix }}backup-borg" + +backup_borg_base_path: "{{ mash_playbook_base_path }}/{{ mash_playbook_service_base_directory_name_prefix }}borg-backup" + +backup_borg_uid: "{{ mash_playbook_uid }}" +backup_borg_gid: "{{ mash_playbook_gid }}" + +backup_borg_container_network: "{{ devture_postgres_container_network if devture_postgres_enabled else backup_borg_identifier }}" + +backup_borg_retention_prefix: "{{ mash_playbook_service_identifier_prefix }}" +backup_borg_storage_archive_name_format: "{{ mash_playbook_service_identifier_prefix }}-{now:%Y-%m-%d-%H%M%S}" + +backup_borg_container_image_self_build: "{{ mash_playbook_architecture not in ['amd64', 'arm32', 'arm64'] }}" + +backup_borg_postgresql_enabled: "{{ devture_postgres_enabled }}" +backup_borg_postgresql_databases_hostname: "{{ devture_postgres_connection_hostname if devture_postgres_enabled else '' }}" +backup_borg_postgresql_databases_username: "{{ devture_postgres_connection_username if devture_postgres_enabled else '' }}" +backup_borg_postgresql_databases_password: "{{ devture_postgres_connection_password if devture_postgres_enabled else '' }}" +backup_borg_postgresql_databases_port: "{{ devture_postgres_connection_port if devture_postgres_enabled else 5432 }}" +backup_borg_postgresql_databases: "{{ devture_postgres_managed_databases | map(attribute='name') if devture_postgres_enabled else [] }}" + +backup_borg_mysql_enabled: "{{ mariadb_enabled }}" +backup_borg_mysql_databases_hostname: "{{ mariadb_identifier if mariadb_enabled else '' }}" +backup_borg_mysql_databases_username: "root" +backup_borg_mysql_databases_password: "{{ mariadb_root_passsword if mariadb_enabled else '' }}" +backup_borg_mysql_databases_port: "{{ devture_postgres_connection_port if mariadb_enabled else 3306 }}" +backup_borg_mysql_databases: "{{ mariadb_managed_databases | map(attribute='name') if mariadb_enabled else [] }}" + +backup_borg_location_source_directories: + - "{{ mash_playbook_base_path }}" + +backup_borg_location_exclude_patterns: | + {{ + ([devture_postgres_data_path] if devture_postgres_enabled else []) + + + ([mariadb_data_path] if mariadb_enabled else []) + }} + +backup_borg_systemd_required_services_list: | + {{ + ['docker.service'] + + + ([devture_postgres_identifier ~ '.service'] if devture_postgres_enabled else []) + + + ([mariadb_identifier ~ '.service'] if mariadb_enabled else []) + }} + +######################################################################## +# # +# /backup-borg # +# # +######################################################################## + + + ######################################################################## # # # collabora-online # diff --git a/requirements.yml b/requirements.yml index 7879998..1ad498a 100644 --- a/requirements.yml +++ b/requirements.yml @@ -12,6 +12,8 @@ - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-aux.git version: v1.0.0-0 name: aux +- src: git+https://gitlab.com/etke.cc/roles/backup_borg.git + version: v1.2.4-1.7.12-2 - src: git+https://github.com/mother-of-all-self-hosting/ansible-role-collabora-online.git version: v22.05.13.1.1-0 name: collabora_online diff --git a/setup.yml b/setup.yml index 6a82a71..2786272 100644 --- a/setup.yml +++ b/setup.yml @@ -60,6 +60,8 @@ - role: galaxy/authentik + - role: galaxy/backup_borg + - role: galaxy/collabora_online - role: galaxy/docker_registry