mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-07-17 22:14:25 +02:00
Shorted backup- to bkp-
This commit is contained in:
parent
d0bd33fee3
commit
9668e74139
@ -15,7 +15,7 @@ Every business is unique, and so is CyMaIS! With a modular architecture, it adap
|
||||
With automated updates, system health checks, and security audits, CyMaIS ensures your infrastructure is always up-to-date and running smoothly. Roles such as `mon-bot-docker-container`, `mon-bot-btrfs`, and `mon-bot-webserver` help monitor system integrity.
|
||||
|
||||
## Uncompromised Security 🔒
|
||||
Security is a top priority! CyMaIS includes robust security features like full-disk encryption recommendations, 2FA enforcement, encrypted server deployments (`web-app-keycloak`, `service-openldap`), and secure backup solutions (`backup-remote-to-local`, `backup-data-to-usb`).
|
||||
Security is a top priority! CyMaIS includes robust security features like full-disk encryption recommendations, 2FA enforcement, encrypted server deployments (`web-app-keycloak`, `service-openldap`), and secure backup solutions (`bkp-remote-to-local`, `bkp-data-to-usb`).
|
||||
|
||||
## User-Friendly with Expert Support 👩💻
|
||||
No need to be a Linux or Docker expert! CyMaIS simplifies deployment with intuitive role-based automation. Documentation and community support make IT administration accessible to all experience levels.
|
||||
|
@ -10,7 +10,7 @@ Follow these guides to install and configure CyMaIS:
|
||||
|
||||
## Key Responsibilities 🔧
|
||||
- **User Management** - Configure LDAP, Keycloak, and user permissions.
|
||||
- **Security & Backups** - Set up `backup-remote-to-local`, `backup-data-to-usb`, and `core-security` roles.
|
||||
- **Security & Backups** - Set up `bkp-remote-to-local`, `bkp-data-to-usb`, and `core-security` roles.
|
||||
- **Application Hosting** - Deploy services like `Nextcloud`, `Matrix`, `Gitea`, and more.
|
||||
- **Networking & VPN** - Configure `WireGuard`, `OpenVPN`, and `Nginx Reverse Proxy`.
|
||||
|
||||
|
@ -13,10 +13,10 @@ system_maintenance_lock_timeout_restart_docker: "{{system_maintenance_lock_ti
|
||||
|
||||
### Defined Services for Backup Tasks
|
||||
system_maintenance_backup_services:
|
||||
- "backup-docker-to-local"
|
||||
- "backup-remote-to-local"
|
||||
- "backup-data-to-usb"
|
||||
- "backup-docker-to-local-everything"
|
||||
- "bkp-docker-to-local"
|
||||
- "bkp-remote-to-local"
|
||||
- "bkp-data-to-usb"
|
||||
- "bkp-docker-to-local-everything"
|
||||
|
||||
### Defined Services for System Cleanup
|
||||
system_maintenance_cleanup_services:
|
||||
|
@ -85,7 +85,7 @@ For a complete list of role categories and detailed definitions, see:
|
||||
|
||||
## Backup & Restore
|
||||
|
||||
- **backup-***
|
||||
- **bkp-***
|
||||
Local and remote backup strategies for files, Docker volumes, databases.
|
||||
|
||||
---
|
||||
@ -113,7 +113,7 @@ For a complete list of role categories and detailed definitions, see:
|
||||
> **Tip:** To find a role quickly, search for its prefix:
|
||||
> `core-`, `generic-`, `desk-`, `webserver-`, `web-service-`, `web-app-`,
|
||||
> `network-`, `service-`, `monitor-`, `alert-`, `maint-`, `cleanup-`,
|
||||
> `backup-`, `update-`, `pkgmgr-`, `user-`.
|
||||
> `bkp-`, `update-`, `pkgmgr-`, `user-`.
|
||||
|
||||
---
|
||||
|
||||
|
@ -1,5 +0,0 @@
|
||||
- name: "reload backup-data-to-usb.cymais.service"
|
||||
systemd:
|
||||
name: backup-data-to-usb.cymais.service
|
||||
state: reloaded
|
||||
daemon_reload: yes
|
@ -1,9 +0,0 @@
|
||||
- name: "reload backup-docker-to-local-everything.cymais.service"
|
||||
systemd:
|
||||
name: backup-docker-to-local-everything.cymais.service
|
||||
daemon_reload: yes
|
||||
|
||||
- name: "reload backup-docker-to-local.cymais.service"
|
||||
systemd:
|
||||
name: backup-docker-to-local.cymais.service
|
||||
daemon_reload: yes
|
@ -1,4 +0,0 @@
|
||||
- name: "reload backup-remote-to-local service"
|
||||
systemd:
|
||||
name: backup-remote-to-local.cymais.service
|
||||
daemon_reload: yes
|
@ -21,7 +21,7 @@ def main():
|
||||
machine_id = subprocess.run(["sha256sum", "/etc/machine-id"], capture_output=True, text=True).stdout.strip()[:64]
|
||||
print(f"machine id: {machine_id}")
|
||||
|
||||
versions_path = os.path.join(backup_to_usb_destination_path, f"{machine_id}/backup-data-to-usb/")
|
||||
versions_path = os.path.join(backup_to_usb_destination_path, f"{machine_id}/bkp-data-to-usb/")
|
||||
print(f"versions path: {versions_path}")
|
||||
|
||||
if not os.path.isdir(versions_path):
|
5
roles/bkp-data-to-usb/handlers/main.yml
Normal file
5
roles/bkp-data-to-usb/handlers/main.yml
Normal file
@ -0,0 +1,5 @@
|
||||
- name: "reload bkp-data-to-usb.cymais.service"
|
||||
systemd:
|
||||
name: bkp-data-to-usb.cymais.service
|
||||
state: reloaded
|
||||
daemon_reload: yes
|
@ -1,6 +1,6 @@
|
||||
- name: Copy backup script to the scripts directory
|
||||
copy:
|
||||
src: backup-data-to-usb.python
|
||||
src: bkp-data-to-usb.python
|
||||
dest: "{{ backup_to_usb_script_path }}"
|
||||
owner: root
|
||||
group: root
|
||||
@ -8,9 +8,9 @@
|
||||
|
||||
- name: Copy systemd service to systemd directory
|
||||
template:
|
||||
src: backup-data-to-usb.service.j2
|
||||
dest: /etc/systemd/system/backup-data-to-usb.cymais.service
|
||||
src: bkp-data-to-usb.service.j2
|
||||
dest: /etc/systemd/system/bkp-data-to-usb.cymais.service
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0644'
|
||||
notify: reload backup-data-to-usb.cymais.service
|
||||
notify: reload bkp-data-to-usb.cymais.service
|
@ -1,4 +1,4 @@
|
||||
backup_to_usb_script_path: "/usr/local/sbin/backup-data-to-usb.python"
|
||||
backup_to_usb_script_path: "/usr/local/sbin/bkp-data-to-usb.python"
|
||||
backup_to_usb_destination: "{{backup_to_usb_mount}}{{backup_to_usb_destination_subdirectory}}"
|
||||
backups_folder_path: "{{backup_to_usb_destination}}"
|
||||
systemctl_mount_service_name: "{{ backup_to_usb_mount | trim('/') | replace('/', '-') }}.mount"
|
@ -2,7 +2,7 @@
|
||||
|
||||
## Description
|
||||
|
||||
This Ansible role installs the [directory-validator](https://github.com/kevinveenbirkenbach/directory-validator.git). It is used by the backup-docker-to-local and cleanup-failed-docker-backups roles to verify whether backups have been successfully created.
|
||||
This Ansible role installs the [directory-validator](https://github.com/kevinveenbirkenbach/directory-validator.git). It is used by the bkp-docker-to-local and cleanup-failed-docker-backups roles to verify whether backups have been successfully created.
|
||||
|
||||
## Overview
|
||||
|
||||
@ -16,5 +16,5 @@ The primary purpose of this role is to validate backup directories. By fetching
|
||||
|
||||
- **Git Repository Pull:** Automatically pulls the latest version of the directory-validator from Git.
|
||||
- **Idempotent Execution:** Ensures that the repository is fetched only once per playbook run.
|
||||
- **Backup Verification:** Serves as a validation step for other backup-related roles.
|
||||
- **Backup Verification:** Serves as a validation step for other bkp-related roles.
|
||||
- **Configurable Destination:** The target folder is customizable via the `backup_directory_validator_folder` variable.
|
@ -2,15 +2,15 @@
|
||||
|
||||
## Description
|
||||
|
||||
This Ansible role automates the process of backing up Docker volumes to a local folder. It pulls the [backup-docker-to-local repository](https://github.com/kevinveenbirkenbach/backup-docker-to-local.git), installs required software, configures systemd services for both standard and "everything" backup modes, and seeds backup database entries as needed.
|
||||
This Ansible role automates the process of backing up Docker volumes to a local folder. It pulls the [bkp-docker-to-local repository](https://github.com/kevinveenbirkenbach/bkp-docker-to-local.git), installs required software, configures systemd services for both standard and "everything" backup modes, and seeds backup database entries as needed.
|
||||
|
||||
## Overview
|
||||
|
||||
Optimized for Archlinux, this role ensures that Docker volume backups are performed reliably with minimal manual intervention. It integrates with several dependent roles to verify backup success and manage related tasks, including:
|
||||
- [backup-directory-validator](../backup-directory-validator/) – Validates backup directories.
|
||||
- [bkp-directory-validator](../bkp-directory-validator/) – Validates backup directories.
|
||||
- [cleanup-failed-docker-backups](../cleanup-failed-docker-backups/) – Cleans up unsuccessful backup attempts.
|
||||
- [generic-timer](../generic-timer/) – Schedules recurring backup tasks.
|
||||
- [backup-provider](../backup-provider/) – Manages backup sources.
|
||||
- [bkp-provider](../bkp-provider/) – Manages backup sources.
|
||||
- [maint-lock](../maint-lock/) – Ensures coordinated maintenance operations.
|
||||
|
||||
## Purpose
|
||||
@ -20,7 +20,7 @@ Backup Docker Volumes to Local is a comprehensive solution that leverages rsync
|
||||
## Features
|
||||
|
||||
- **Required Software Installation:** Installs necessary packages (e.g., lsof, python-pandas) via pacman.
|
||||
- **Git Repository Pull:** Automatically pulls the latest version of the [backup-docker-to-local repository](https://github.com/kevinveenbirkenbach/backup-docker-to-local.git).
|
||||
- **Git Repository Pull:** Automatically pulls the latest version of the [bkp-docker-to-local repository](https://github.com/kevinveenbirkenbach/bkp-docker-to-local.git).
|
||||
- **Systemd Service Configuration:** Deploys and reloads two systemd service templates to manage backup tasks.
|
||||
- **Database Seeding:** Includes tasks to seed and manage a backup database (`databases.csv`) for tracking backup details.
|
||||
- **Dependency Integration:** Works in conjunction with the dependent roles listed above to verify and manage backups.
|
9
roles/bkp-docker-to-local/handlers/main.yml
Normal file
9
roles/bkp-docker-to-local/handlers/main.yml
Normal file
@ -0,0 +1,9 @@
|
||||
- name: "reload bkp-docker-to-local-everything.cymais.service"
|
||||
systemd:
|
||||
name: bkp-docker-to-local-everything.cymais.service
|
||||
daemon_reload: yes
|
||||
|
||||
- name: "reload bkp-docker-to-local.cymais.service"
|
||||
systemd:
|
||||
name: bkp-docker-to-local.cymais.service
|
||||
daemon_reload: yes
|
@ -23,8 +23,8 @@ galaxy_info:
|
||||
issue_tracker_url: "https://s.veen.world/cymaisissues"
|
||||
documentation: "https://s.veen.world/cymais"
|
||||
dependencies:
|
||||
- backup-provider
|
||||
- bkp-provider
|
||||
- alert-compose
|
||||
- cleanup-failed-docker-backups
|
||||
- maint-lock
|
||||
- backup-directory-validator
|
||||
- bkp-directory-validator
|
@ -2,11 +2,11 @@
|
||||
include_role:
|
||||
name: pkgmgr-install
|
||||
vars:
|
||||
package_name: backup-docker-to-local
|
||||
package_name: bkp-docker-to-local
|
||||
when: run_once_backup_docker_to_local is not defined
|
||||
|
||||
- name: Retrieve backup-docker-to-local path from pkgmgr
|
||||
command: pkgmgr path backup-docker-to-local
|
||||
- name: Retrieve bkp-docker-to-local path from pkgmgr
|
||||
command: pkgmgr path bkp-docker-to-local
|
||||
register: pkgmgr_output
|
||||
changed_when: false
|
||||
when: run_once_backup_docker_to_local is not defined
|
||||
@ -17,18 +17,18 @@
|
||||
changed_when: false
|
||||
when: run_once_backup_docker_to_local is not defined
|
||||
|
||||
- name: configure backup-docker-to-local-everything.cymais.service
|
||||
- name: configure bkp-docker-to-local-everything.cymais.service
|
||||
template:
|
||||
src: backup-docker-to-local-everything.service.j2
|
||||
dest: /etc/systemd/system/backup-docker-to-local-everything.cymais.service
|
||||
notify: reload backup-docker-to-local-everything.cymais.service
|
||||
src: bkp-docker-to-local-everything.service.j2
|
||||
dest: /etc/systemd/system/bkp-docker-to-local-everything.cymais.service
|
||||
notify: reload bkp-docker-to-local-everything.cymais.service
|
||||
when: run_once_backup_docker_to_local is not defined
|
||||
|
||||
- name: configure backup-docker-to-local.cymais.service
|
||||
- name: configure bkp-docker-to-local.cymais.service
|
||||
template:
|
||||
src: backup-docker-to-local.service.j2
|
||||
dest: /etc/systemd/system/backup-docker-to-local.cymais.service
|
||||
notify: reload backup-docker-to-local.cymais.service
|
||||
src: bkp-docker-to-local.service.j2
|
||||
dest: /etc/systemd/system/bkp-docker-to-local.cymais.service
|
||||
notify: reload bkp-docker-to-local.cymais.service
|
||||
when: run_once_backup_docker_to_local is not defined
|
||||
|
||||
- name: set service_name to the name of the current role
|
@ -4,6 +4,6 @@ OnFailure=alert-compose.cymais@%n.service cleanup-failed-docker-backups.cymais.s
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStartPre=/bin/sh -c '/usr/bin/python {{ path_system_lock_script }} {{ system_maintenance_services | join(' ') }} --ignore {{ system_maintenance_backup_services | reject('equalto', 'backup-docker-to-local') | join(' ') }} --timeout "{{system_maintenance_lock_timeout_backup_services}}"'
|
||||
ExecStartPre=/bin/sh -c '/usr/bin/python {{ path_system_lock_script }} {{ system_maintenance_services | join(' ') }} --ignore {{ system_maintenance_backup_services | reject('equalto', 'bkp-docker-to-local') | join(' ') }} --timeout "{{system_maintenance_lock_timeout_backup_services}}"'
|
||||
ExecStart=/bin/sh -c '/usr/bin/python {{backup_docker_to_local_folder}}backup-docker-to-local.py --compose-dir {{path_docker_compose_instances}} --everything'
|
||||
ExecStartPost=/bin/sh -c '/bin/systemctl start maint-docker-heal.cymais.service &'
|
@ -4,6 +4,6 @@ OnFailure=alert-compose.cymais@%n.service cleanup-failed-docker-backups.cymais.s
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStartPre=/bin/sh -c '/usr/bin/python {{ path_system_lock_script }} {{ system_maintenance_services | join(' ') }} --ignore {{ system_maintenance_backup_services | reject('equalto', 'backup-docker-to-local-everything') | join(' ') }} --timeout "{{system_maintenance_lock_timeout_backup_services}}"'
|
||||
ExecStartPre=/bin/sh -c '/usr/bin/python {{ path_system_lock_script }} {{ system_maintenance_services | join(' ') }} --ignore {{ system_maintenance_backup_services | reject('equalto', 'bkp-docker-to-local-everything') | join(' ') }} --timeout "{{system_maintenance_lock_timeout_backup_services}}"'
|
||||
ExecStart=/bin/sh -c '/usr/bin/python {{backup_docker_to_local_folder}}backup-docker-to-local.py --compose-dir {{path_docker_compose_instances}}'
|
||||
ExecStartPost=/bin/sh -c '/bin/systemctl start maint-docker-heal.cymais.service &'
|
@ -12,8 +12,8 @@ hashed_machine_id="$($get_hashed_machine_id | head -c 64)"
|
||||
get_backup_types="find /Backups/$hashed_machine_id/ -maxdepth 1 -type d -execdir basename {} ;";
|
||||
|
||||
|
||||
# @todo This configuration is not scalable yet. If other backup services then backup-docker-to-local are integrated, this logic needs to be optimized
|
||||
get_version_directories="ls -d /Backups/$hashed_machine_id/backup-docker-to-local/*"
|
||||
# @todo This configuration is not scalable yet. If other backup services then bkp-docker-to-local are integrated, this logic needs to be optimized
|
||||
get_version_directories="ls -d /Backups/$hashed_machine_id/bkp-docker-to-local/*"
|
||||
last_version_directory="$($get_version_directories | tail -1)"
|
||||
rsync_command="sudo rsync --server --sender -blogDtpre.iLsfxCIvu . $last_version_directory/"
|
||||
|
@ -8,7 +8,7 @@ This role sets up and manages the host as a backup provider. It establishes the
|
||||
|
||||
Optimized for automated backup processes, this role:
|
||||
- Configures the host to provide backup services.
|
||||
- Integrates seamlessly with the [backup-provider-user](../backup-provider-user/README.md) and [cleanup-backups-timer](../cleanup-backups-timer/README.md) roles.
|
||||
- Integrates seamlessly with the [bkp-provider-user](../bkp-provider-user/README.md) and [cleanup-backups-timer](../cleanup-backups-timer/README.md) roles.
|
||||
- Lays the foundation for secure and extensible backup operations.
|
||||
|
||||
## Purpose
|
@ -23,5 +23,5 @@ galaxy_info:
|
||||
issue_tracker_url: "https://s.veen.world/cymaisissues"
|
||||
documentation: "https://s.veen.world/cymais"
|
||||
dependencies:
|
||||
- backup-provider-user
|
||||
- bkp-provider-user
|
||||
- cleanup-backups-timer
|
@ -9,17 +9,17 @@ To track what the service is doing, execute one of the following commands:
|
||||
#### Using systemctl
|
||||
|
||||
```bash
|
||||
watch -n2 "systemctl status backup-remote-to-local.cymais.service"
|
||||
watch -n2 "systemctl status bkp-remote-to-local.cymais.service"
|
||||
```
|
||||
|
||||
#### Using journalctl
|
||||
|
||||
```bash
|
||||
journalctl -fu backup-remote-to-local.cymais.service
|
||||
journalctl -fu bkp-remote-to-local.cymais.service
|
||||
```
|
||||
|
||||
### Viewing History
|
||||
|
||||
```bash
|
||||
sudo journalctl -u backup-remote-to-local.cymais.service
|
||||
sudo journalctl -u bkp-remote-to-local.cymais.service
|
||||
```
|
@ -17,14 +17,14 @@ Backup Remote to Local is a robust solution for retrieving backup data from remo
|
||||
- **Remote Backup Retrieval:** Pulls backups from a remote server using secure SSH connections.
|
||||
- **Incremental Backup with rsync:** Uses rsync with options for archive, backup, and hard linking to efficiently manage changes.
|
||||
- **Retry Logic:** Implements a retry mechanism to handle transient network issues or remote errors.
|
||||
- **Integration with Other Roles:** Works alongside roles like backup-directory-validator, cleanup-failed-docker-backups, generic-timer, backup-provider, and maint-lock.
|
||||
- **Integration with Other Roles:** Works alongside roles like bkp-directory-validator, cleanup-failed-docker-backups, generic-timer, bkp-provider, and maint-lock.
|
||||
- **Administrative Debugging:** Detailed debug instructions and administrative tasks are provided in a separate file.
|
||||
|
||||
## Other Resources
|
||||
|
||||
- **Backup Scheme:**
|
||||

|
||||
More details can be found in [this blog post](https://www.veen.world/2020/12/26/how-i-backup-dedicated-root-servers/).
|
||||

|
||||
More details can be found in [this blog post](https://blog.veen.world/2020/12/26/how-i-backup-dedicated-root-servers/).
|
||||
|
||||
## Administration & Debugging
|
||||
|
4
roles/bkp-remote-to-local/handlers/main.yml
Normal file
4
roles/bkp-remote-to-local/handlers/main.yml
Normal file
@ -0,0 +1,4 @@
|
||||
- name: "reload bkp-remote-to-local service"
|
||||
systemd:
|
||||
name: bkp-remote-to-local.cymais.service
|
||||
daemon_reload: yes
|
@ -4,17 +4,17 @@
|
||||
state: directory
|
||||
mode: 0755
|
||||
|
||||
- name: create backup-remote-to-local.sh
|
||||
- name: create bkp-remote-to-local.sh
|
||||
copy:
|
||||
src: backup-remote-to-local.sh
|
||||
dest: "{{docker_backup_remote_to_local_folder}}backup-remote-to-local.sh"
|
||||
src: bkp-remote-to-local.sh
|
||||
dest: "{{docker_backup_remote_to_local_folder}}bkp-remote-to-local.sh"
|
||||
mode: 0755
|
||||
|
||||
- name: create backup-remote-to-local.cymais.service
|
||||
- name: create bkp-remote-to-local.cymais.service
|
||||
template:
|
||||
src: backup-remote-to-local.service.j2
|
||||
dest: /etc/systemd/system/backup-remote-to-local.cymais.service
|
||||
notify: reload backup-remote-to-local service
|
||||
src: bkp-remote-to-local.service.j2
|
||||
dest: /etc/systemd/system/bkp-remote-to-local.cymais.service
|
||||
notify: reload bkp-remote-to-local service
|
||||
|
||||
- name: create backups-remote-to-local.sh
|
||||
template:
|
@ -3,6 +3,6 @@
|
||||
hosts="{{ pull_remote_backups | join(' ') }}";
|
||||
errors=0
|
||||
for host in $hosts; do
|
||||
bash {{ docker_backup_remote_to_local_folder }}backup-remote-to-local.sh $host || ((errors+=1));
|
||||
bash {{ docker_backup_remote_to_local_folder }}bkp-remote-to-local.sh $host || ((errors+=1));
|
||||
done;
|
||||
exit $errors;
|
@ -1 +1 @@
|
||||
docker_backup_remote_to_local_folder: "{{path_administrator_scripts}}backup-remote-to-local/"
|
||||
docker_backup_remote_to_local_folder: "{{path_administrator_scripts}}bkp-remote-to-local/"
|
@ -10,7 +10,7 @@ Optimized for backup maintenance, this role:
|
||||
- Clones the cleanup-failed-docker-backups repository.
|
||||
- Configures a systemd service to run the cleanup script.
|
||||
- Integrates with the [generic-timer](../generic-timer/README.md) role to schedule periodic cleanup.
|
||||
- Works in conjunction with the backup-directory-validator role for additional verification.
|
||||
- Works in conjunction with the bkp-directory-validator role for additional verification.
|
||||
|
||||
## Purpose
|
||||
|
||||
@ -21,4 +21,4 @@ The primary purpose of this role is to remove failed Docker backups automaticall
|
||||
- **Repository Cloning:** Retrieves the latest cleanup scripts from a Git repository.
|
||||
- **Service Configuration:** Sets up a systemd service to run the cleanup tasks.
|
||||
- **Timer Integration:** Schedules periodic cleanup through a systemd timer.
|
||||
- **Dependency Integration:** Works with backup-directory-validator to enhance backup integrity.
|
||||
- **Dependency Integration:** Works with bkp-directory-validator to enhance backup integrity.
|
@ -24,4 +24,4 @@ galaxy_info:
|
||||
dependencies:
|
||||
- alert-compose
|
||||
- maint-lock
|
||||
- backup-directory-validator
|
||||
- bkp-directory-validator
|
||||
|
@ -5,7 +5,7 @@
|
||||
package_name: cleanup-failed-docker-backups
|
||||
when: run_once_cleanup_failed_docker_backups is not defined
|
||||
|
||||
- name: Retrieve backup-docker-to-local path from pkgmgr
|
||||
- name: Retrieve bkp-docker-to-local path from pkgmgr
|
||||
command: pkgmgr path cleanup-failed-docker-backups
|
||||
register: pkgmgr_output
|
||||
changed_when: false
|
||||
|
@ -10,7 +10,7 @@ Targeting user environments on Arch Linux (e.g., Manjaro), this role sets up the
|
||||
|
||||
## Purpose
|
||||
|
||||
The purpose of this role is to automate the configuration of cloud-integrated user directories by ensuring that common folders like `Downloads`, `Music`, and `Workspaces` are transparently redirected into a centralized cloud structure. This makes it easier to maintain backup-friendly, cloud-ready setups for homelab and professional workflows.
|
||||
The purpose of this role is to automate the configuration of cloud-integrated user directories by ensuring that common folders like `Downloads`, `Music`, and `Workspaces` are transparently redirected into a centralized cloud structure. This makes it easier to maintain bkp-friendly, cloud-ready setups for homelab and professional workflows.
|
||||
|
||||
## Features
|
||||
|
||||
|
@ -27,7 +27,7 @@ galaxy_info:
|
||||
documentation: "https://s.veen.world/cymais/docker"
|
||||
|
||||
dependencies:
|
||||
- backup-docker-to-local
|
||||
- bkp-docker-to-local
|
||||
- user-administrator
|
||||
- mon-bot-docker-container
|
||||
- mon-bot-docker-volumes
|
||||
|
@ -40,7 +40,7 @@ def main(base_directory):
|
||||
|
||||
while blocker_running:
|
||||
try:
|
||||
bash("systemctl is-active --quiet backup-docker-to-local.cymais.service")
|
||||
bash("systemctl is-active --quiet bkp-docker-to-local.cymais.service")
|
||||
bash("systemctl is-active --quiet update-docker.cymais.service")
|
||||
print("Backup is running.")
|
||||
print(f"Trying again in {waiting_time} seconds.")
|
||||
|
@ -4,5 +4,5 @@ OnFailure=alert-compose.cymais@%n.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStartPre=/bin/sh -c '/usr/bin/python {{ path_system_lock_script }} {{ system_maintenance_services | join(' ') }} --ignore maint-docker-storage-optimizer backup-remote-to-local --timeout "{{system_maintenance_lock_timeout_storage_optimizer}}"'
|
||||
ExecStartPre=/bin/sh -c '/usr/bin/python {{ path_system_lock_script }} {{ system_maintenance_services | join(' ') }} --ignore maint-docker-storage-optimizer bkp-remote-to-local --timeout "{{system_maintenance_lock_timeout_storage_optimizer}}"'
|
||||
ExecStart=/bin/sh -c '/usr/bin/python {{storage_optimizer_script}} --rapid-storage-path {{path_rapid_storage}} --mass-storage-path {{path_mass_storage}}'
|
@ -28,4 +28,4 @@
|
||||
when: applications | is_feature_enabled('central_database',application_id)
|
||||
|
||||
- name: "Add database to backup"
|
||||
include_tasks: "{{ playbook_dir }}/roles/backup-docker-to-local/tasks/seed-database-to-backup.yml"
|
||||
include_tasks: "{{ playbook_dir }}/roles/bkp-docker-to-local/tasks/seed-database-to-backup.yml"
|
@ -1,6 +1,6 @@
|
||||
- name: "start backup-docker-to-local-everything.cymais.service"
|
||||
- name: "start bkp-docker-to-local-everything.cymais.service"
|
||||
systemd:
|
||||
name: backup-docker-to-local-everything.cymais.service
|
||||
name: bkp-docker-to-local-everything.cymais.service
|
||||
state: started
|
||||
when: mode_backup | bool
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
database_name: "" # Multiple databases
|
||||
|
||||
- name: "Seed BigBlueButton Database for Backup"
|
||||
include_tasks: "{{ playbook_dir }}/roles/backup-docker-to-local/tasks/seed-database-to-backup.yml"
|
||||
include_tasks: "{{ playbook_dir }}/roles/bkp-docker-to-local/tasks/seed-database-to-backup.yml"
|
||||
vars:
|
||||
database_instance: "{{ application_id }}"
|
||||
database_password: "{{ applications[application_id].credentials.postgresql_secret }}"
|
||||
|
@ -10,4 +10,4 @@
|
||||
when: applications | is_feature_enabled('central_database',application_id)
|
||||
|
||||
- name: "include seed-database-to-backup.yml"
|
||||
include_tasks: "{{ playbook_dir }}/roles/backup-docker-to-local/tasks/seed-database-to-backup.yml"
|
||||
include_tasks: "{{ playbook_dir }}/roles/bkp-docker-to-local/tasks/seed-database-to-backup.yml"
|
@ -43,8 +43,8 @@ and disable any non-functioning apps.
|
||||
```bash
|
||||
cd {{path_docker_compose_instances}}nextcloud &&
|
||||
docker-compose down &&
|
||||
docker-compose exec -i database mysql -u nextcloud -pPASSWORT nextcloud < "/Backups/$(sha256sum /etc/machine-id | head -c 64)/backup-docker-to-local/latest/nextcloud_database/sql/backup.sql" &&
|
||||
cd {{path_administrator_scripts}}backup-docker-to-local &&
|
||||
docker-compose exec -i database mysql -u nextcloud -pPASSWORT nextcloud < "/Backups/$(sha256sum /etc/machine-id | head -c 64)/bkp-docker-to-local/latest/nextcloud_database/sql/backup.sql" &&
|
||||
cd {{path_administrator_scripts}}bkp-docker-to-local &&
|
||||
bash ./recover-web-app-from-local.sh "nextcloud_data" "$(sha256sum /etc/machine-id | head -c 64)"
|
||||
```
|
||||
|
||||
|
@ -120,12 +120,12 @@
|
||||
## backup setup
|
||||
- name: setup replica backup hosts
|
||||
when: ('backup_remote_to_local' | application_allowed(group_names, allowed_applications))
|
||||
include_role: backup-remote-to-local
|
||||
include_role: bkp-remote-to-local
|
||||
|
||||
- name: setup backup to swappable
|
||||
when: ('backup_to_usb' | application_allowed(group_names, allowed_applications))
|
||||
include_role:
|
||||
name: backup-data-to-usb
|
||||
name: bkp-data-to-usb
|
||||
|
||||
## driver setup
|
||||
- name: driver-intel
|
||||
|
Loading…
x
Reference in New Issue
Block a user