Shorted maintenance- to maint-

This commit is contained in:
Kevin Veen-Birkenbach 2025-07-09 03:25:03 +02:00
parent ae5f021b8d
commit d0bd33fee3
No known key found for this signature in database
GPG Key ID: 44D8F11FD62F878E
63 changed files with 96 additions and 96 deletions

View File

@ -17,6 +17,6 @@ Follow these guides to install and configure CyMaIS:
## Managing & Updating CyMaIS 🔄 ## Managing & Updating CyMaIS 🔄
- Regularly update services using `update-docker`, `update-pacman`, or `update-apt`. - Regularly update services using `update-docker`, `update-pacman`, or `update-apt`.
- Monitor system health with `mon-bot-btrfs`, `mon-bot-webserver`, and `mon-bot-docker-container`. - Monitor system health with `mon-bot-btrfs`, `mon-bot-webserver`, and `mon-bot-docker-container`.
- Automate system maintenance with `maintenance-lock`, `cleanup-backups-service`, and `maintenance-docker-restart`. - Automate system maintenance with `maint-lock`, `cleanup-backups-service`, and `maint-docker-restart`.
For more details, refer to the specific guides above. For more details, refer to the specific guides above.

View File

@ -26,10 +26,10 @@ system_maintenance_cleanup_services:
### Services that Manipulate the System ### Services that Manipulate the System
system_maintenance_manipulation_services: system_maintenance_manipulation_services:
- "maintenance-docker-heal" - "maint-docker-heal"
- "update-docker" - "update-docker"
- "maintenance-docker-storage-optimizer" - "maint-docker-storage-optimizer"
- "maintenance-docker-restart" - "maint-docker-restart"
## Total System Maintenance Services ## Total System Maintenance Services
system_maintenance_services: "{{ system_maintenance_backup_services + system_maintenance_cleanup_services + system_maintenance_manipulation_services }}" system_maintenance_services: "{{ system_maintenance_backup_services + system_maintenance_cleanup_services + system_maintenance_manipulation_services }}"

View File

@ -3,4 +3,4 @@
path_administrator_home: "/home/administrator/" path_administrator_home: "/home/administrator/"
path_administrator_scripts: "/opt/scripts/" path_administrator_scripts: "/opt/scripts/"
path_docker_compose_instances: "/opt/docker/" path_docker_compose_instances: "/opt/docker/"
path_system_lock_script: "/opt/scripts/maintenance-lock.py" path_system_lock_script: "/opt/scripts/maint-lock.py"

View File

@ -72,10 +72,10 @@ For a complete list of role categories and detailed definitions, see:
## Maintenance & Healing ## Maintenance & Healing
- **maintenance-*** - **maint-***
Periodic maintenance tasks (Btrfs balancing, swapfile management). Periodic maintenance tasks (Btrfs balancing, swapfile management).
- **maintenance-docker-*** - **maint-docker-***
Automated recovery and restarts for Docker Compose workloads. Automated recovery and restarts for Docker Compose workloads.
- **cleanup-*** - **cleanup-***
@ -112,7 +112,7 @@ For a complete list of role categories and detailed definitions, see:
> **Tip:** To find a role quickly, search for its prefix: > **Tip:** To find a role quickly, search for its prefix:
> `core-`, `generic-`, `desk-`, `webserver-`, `web-service-`, `web-app-`, > `core-`, `generic-`, `desk-`, `webserver-`, `web-service-`, `web-app-`,
> `network-`, `service-`, `monitor-`, `alert-`, `maintenance-`, `cleanup-`, > `network-`, `service-`, `monitor-`, `alert-`, `maint-`, `cleanup-`,
> `backup-`, `update-`, `pkgmgr-`, `user-`. > `backup-`, `update-`, `pkgmgr-`, `user-`.
--- ---

View File

@ -24,4 +24,4 @@ galaxy_info:
documentation: https://s.veen.world/cymais documentation: https://s.veen.world/cymais
dependencies: dependencies:
- cleanup-backups-service - cleanup-backups-service
- maintenance-lock - maint-lock

View File

@ -11,7 +11,7 @@ Optimized for Archlinux, this role ensures that Docker volume backups are perfor
- [cleanup-failed-docker-backups](../cleanup-failed-docker-backups/) Cleans up unsuccessful backup attempts. - [cleanup-failed-docker-backups](../cleanup-failed-docker-backups/) Cleans up unsuccessful backup attempts.
- [generic-timer](../generic-timer/) Schedules recurring backup tasks. - [generic-timer](../generic-timer/) Schedules recurring backup tasks.
- [backup-provider](../backup-provider/) Manages backup sources. - [backup-provider](../backup-provider/) Manages backup sources.
- [maintenance-lock](../maintenance-lock/) Ensures coordinated maintenance operations. - [maint-lock](../maint-lock/) Ensures coordinated maintenance operations.
## Purpose ## Purpose

View File

@ -26,5 +26,5 @@ dependencies:
- backup-provider - backup-provider
- alert-compose - alert-compose
- cleanup-failed-docker-backups - cleanup-failed-docker-backups
- maintenance-lock - maint-lock
- backup-directory-validator - backup-directory-validator

View File

@ -6,4 +6,4 @@ OnFailure=alert-compose.cymais@%n.service cleanup-failed-docker-backups.cymais.s
Type=oneshot 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', 'backup-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' 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 maintenance-docker-heal.cymais.service &' ExecStartPost=/bin/sh -c '/bin/systemctl start maint-docker-heal.cymais.service &'

View File

@ -6,4 +6,4 @@ OnFailure=alert-compose.cymais@%n.service cleanup-failed-docker-backups.cymais.s
Type=oneshot 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', 'backup-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}}' 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 maintenance-docker-heal.cymais.service &' ExecStartPost=/bin/sh -c '/bin/systemctl start maint-docker-heal.cymais.service &'

View File

@ -17,7 +17,7 @@ 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. - **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. - **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. - **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 maintenance-lock. - **Integration with Other Roles:** Works alongside roles like backup-directory-validator, cleanup-failed-docker-backups, generic-timer, backup-provider, and maint-lock.
- **Administrative Debugging:** Detailed debug instructions and administrative tasks are provided in a separate file. - **Administrative Debugging:** Detailed debug instructions and administrative tasks are provided in a separate file.
## Other Resources ## Other Resources

View File

@ -29,5 +29,5 @@ dependencies:
- alert-compose - alert-compose
- cleanup-backups-timer - cleanup-backups-timer
- cleanup-failed-docker-backups - cleanup-failed-docker-backups
- maintenance-lock - maint-lock
- user-root - user-root

View File

@ -24,4 +24,4 @@ galaxy_info:
dependencies: dependencies:
- generic-python-pip - generic-python-pip
- alert-compose - alert-compose
- maintenance-lock - maint-lock

View File

@ -23,4 +23,4 @@ galaxy_info:
documentation: "https://s.veen.world/cymais" documentation: "https://s.veen.world/cymais"
dependencies: dependencies:
- alert-compose - alert-compose
- maintenance-lock - maint-lock

View File

@ -23,5 +23,5 @@ galaxy_info:
documentation: "https://s.veen.world/cymais" documentation: "https://s.veen.world/cymais"
dependencies: dependencies:
- alert-compose - alert-compose
- maintenance-lock - maint-lock
- backup-directory-validator - backup-directory-validator

View File

@ -31,5 +31,5 @@ dependencies:
- user-administrator - user-administrator
- mon-bot-docker-container - mon-bot-docker-container
- mon-bot-docker-volumes - mon-bot-docker-volumes
- maintenance-docker-heal - maint-docker-heal
- maintenance-docker-restart - maint-docker-restart

View File

@ -16,7 +16,7 @@
group: administrator group: administrator
when: run_once_docker is not defined when: run_once_docker is not defined
- name: Set docker_enabled to true, to activate maintenance-docker-storage-optimizer - name: Set docker_enabled to true, to activate maint-docker-storage-optimizer
set_fact: set_fact:
docker_enabled: true docker_enabled: true
when: run_once_docker is not defined when: run_once_docker is not defined

View File

@ -0,0 +1,4 @@
- name: "reload maint-btrfs-auto-balancer.cymais.service"
systemd:
name: maint-btrfs-auto-balancer.cymais.service
daemon_reload: yes

View File

@ -5,11 +5,11 @@
package_name: btrfs-auto-balancer package_name: btrfs-auto-balancer
when: run_once_system_btrfs_auto_balancer is not defined when: run_once_system_btrfs_auto_balancer is not defined
- name: configure maintenance-btrfs-auto-balancer.cymais.service - name: configure maint-btrfs-auto-balancer.cymais.service
template: template:
src: maintenance-btrfs-auto-balancer.service.j2 src: maint-btrfs-auto-balancer.service.j2
dest: /etc/systemd/system/maintenance-btrfs-auto-balancer.cymais.service dest: /etc/systemd/system/maint-btrfs-auto-balancer.cymais.service
notify: reload maintenance-btrfs-auto-balancer.cymais.service notify: reload maint-btrfs-auto-balancer.cymais.service
when: run_once_system_btrfs_auto_balancer is not defined when: run_once_system_btrfs_auto_balancer is not defined
- name: set service_name to the name of the current role - name: set service_name to the name of the current role

View File

@ -0,0 +1,5 @@
- name: restart maint-docker-heal.cymais.service
systemd:
name: maint-docker-heal.cymais.service
state: restarted
daemon_reload: yes

View File

@ -23,4 +23,4 @@ galaxy_info:
issue_tracker_url: https://s.veen.world/cymaisissues issue_tracker_url: https://s.veen.world/cymaisissues
documentation: https://s.veen.world/cymais documentation: https://s.veen.world/cymais
dependencies: dependencies:
- maintenance-lock - maint-lock

View File

@ -5,18 +5,18 @@
mode: 0755 mode: 0755
when: run_once_heal_docker is not defined when: run_once_heal_docker is not defined
- name: create maintenance-docker-heal.py - name: create maint-docker-heal.py
copy: copy:
src: maintenance-docker-heal.py src: maint-docker-heal.py
dest: "{{heal_docker}}maintenance-docker-heal.py" dest: "{{heal_docker}}maint-docker-heal.py"
notify: restart maintenance-docker-heal.cymais.service notify: restart maint-docker-heal.cymais.service
when: run_once_heal_docker is not defined when: run_once_heal_docker is not defined
- name: create maintenance-docker-heal.cymais.service - name: create maint-docker-heal.cymais.service
template: template:
src: maintenance-docker-heal.service.j2 src: maint-docker-heal.service.j2
dest: /etc/systemd/system/maintenance-docker-heal.cymais.service dest: /etc/systemd/system/maint-docker-heal.cymais.service
notify: restart maintenance-docker-heal.cymais.service notify: restart maint-docker-heal.cymais.service
when: run_once_heal_docker is not defined when: run_once_heal_docker is not defined
- name: set service_name to the name of the current role - name: set service_name to the name of the current role

View File

@ -4,5 +4,5 @@ OnFailure=alert-compose.cymais@%n.service
[Service] [Service]
Type=oneshot Type=oneshot
ExecStartPre=/bin/sh -c '/usr/bin/python {{ path_system_lock_script }} {{ system_maintenance_services | join(' ') }} --ignore {{system_maintenance_cleanup_services| join(' ') }} maintenance-docker-heal --timeout "{{system_maintenance_lock_timeout_heal_docker}}"' ExecStartPre=/bin/sh -c '/usr/bin/python {{ path_system_lock_script }} {{ system_maintenance_services | join(' ') }} --ignore {{system_maintenance_cleanup_services| join(' ') }} maint-docker-heal --timeout "{{system_maintenance_lock_timeout_heal_docker}}"'
ExecStart=/bin/sh -c '/bin/python {{heal_docker}}maintenance-docker-heal.py {{path_docker_compose_instances}}' ExecStart=/bin/sh -c '/bin/python {{heal_docker}}maint-docker-heal.py {{path_docker_compose_instances}}'

View File

@ -0,0 +1 @@
heal_docker: "{{path_administrator_scripts}}maint-docker-heal/"

View File

@ -0,0 +1,5 @@
- name: "reload maint-docker-restart.cymais.service"
systemd:
name: maint-docker-restart.cymais.service
enabled: yes
daemon_reload: yes

View File

@ -26,4 +26,4 @@ galaxy_info:
issue_tracker_url: "https://s.veen.world/cymaisissues" issue_tracker_url: "https://s.veen.world/cymaisissues"
documentation: "https://s.veen.world/cymais" documentation: "https://s.veen.world/cymais"
dependencies: dependencies:
- maintenance-lock - maint-lock

View File

@ -7,14 +7,14 @@
- name: create {{restart_docker_script}} - name: create {{restart_docker_script}}
copy: copy:
src: maintenance-docker-restart.py src: maint-docker-restart.py
dest: "{{restart_docker_script}}" dest: "{{restart_docker_script}}"
- name: configure maintenance-docker-restart.cymais.service - name: configure maint-docker-restart.cymais.service
template: template:
src: maintenance-docker-restart.service.j2 src: maint-docker-restart.service.j2
dest: /etc/systemd/system/maintenance-docker-restart.cymais.service dest: /etc/systemd/system/maint-docker-restart.cymais.service
notify: "reload maintenance-docker-restart.cymais.service" notify: "reload maint-docker-restart.cymais.service"
- name: set service_name to the name of the current role - name: set service_name to the name of the current role
set_fact: set_fact:

View File

@ -4,5 +4,5 @@ OnFailure=alert-compose.cymais@%n.service
[Service] [Service]
Type=oneshot Type=oneshot
ExecStartPre=/bin/sh -c '/usr/bin/python {{ path_system_lock_script }} {{ system_maintenance_services | join(' ') }} --ignore {{system_maintenance_cleanup_services | join(' ') }} maintenance-docker-restart --timeout "{{system_maintenance_lock_timeout_restart_docker}}"' ExecStartPre=/bin/sh -c '/usr/bin/python {{ path_system_lock_script }} {{ system_maintenance_services | join(' ') }} --ignore {{system_maintenance_cleanup_services | join(' ') }} maint-docker-restart --timeout "{{system_maintenance_lock_timeout_restart_docker}}"'
ExecStart=/bin/sh -c '/usr/bin/python {{restart_docker_script}} {{path_docker_compose_instances}}' ExecStart=/bin/sh -c '/usr/bin/python {{restart_docker_script}} {{path_docker_compose_instances}}'

View File

@ -0,0 +1,2 @@
restart_docker_folder: "{{path_administrator_scripts}}maint-docker-restart/"
restart_docker_script: "{{restart_docker_folder}}maint-docker-restart.py"

View File

@ -0,0 +1,5 @@
- name: "reload maint-docker-storage-optimizer.cymais.service"
systemd:
name: maint-docker-storage-optimizer.cymais.service
state: reloaded
daemon_reload: yes

View File

@ -0,0 +1,22 @@
- name: "create {{storage_optimizer_directory}}"
file:
path: "{{storage_optimizer_directory}}"
state: directory
mode: 0755
- name: create maint-docker-storage-optimizer.cymais.service
template:
src: maint-docker-storage-optimizer.service.j2
dest: /etc/systemd/system/maint-docker-storage-optimizer.cymais.service
notify: reload maint-docker-storage-optimizer.cymais.service
- name: create maint-docker-storage-optimizer.py
copy:
src: maint-docker-storage-optimizer.py
dest: "{{storage_optimizer_script}}"
mode: 0755
- name: "optimize storage performance"
systemd:
name: maint-docker-storage-optimizer.cymais.service
state: started

View File

@ -4,5 +4,5 @@ OnFailure=alert-compose.cymais@%n.service
[Service] [Service]
Type=oneshot Type=oneshot
ExecStartPre=/bin/sh -c '/usr/bin/python {{ path_system_lock_script }} {{ system_maintenance_services | join(' ') }} --ignore maintenance-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 backup-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}}' ExecStart=/bin/sh -c '/usr/bin/python {{storage_optimizer_script}} --rapid-storage-path {{path_rapid_storage}} --mass-storage-path {{path_mass_storage}}'

View File

@ -1,2 +1,2 @@
storage_optimizer_directory: "{{path_administrator_scripts}}maintenance-docker-storage-optimizer/" storage_optimizer_directory: "{{path_administrator_scripts}}maint-docker-storage-optimizer/"
storage_optimizer_script: "{{storage_optimizer_directory}}maintenance-docker-storage-optimizer.py" storage_optimizer_script: "{{storage_optimizer_directory}}maint-docker-storage-optimizer.py"

View File

@ -1,7 +1,7 @@
--- ---
- name: create {{path_system_lock_script}} - name: create {{path_system_lock_script}}
copy: copy:
src: maintenance-lock.py src: maint-lock.py
dest: "{{path_system_lock_script}}" dest: "{{path_system_lock_script}}"
when: run_once_system_maintenance_lock is not defined when: run_once_system_maintenance_lock is not defined

View File

@ -1,4 +0,0 @@
- name: "reload maintenance-btrfs-auto-balancer.cymais.service"
systemd:
name: maintenance-btrfs-auto-balancer.cymais.service
daemon_reload: yes

View File

@ -1,5 +0,0 @@
- name: restart maintenance-docker-heal.cymais.service
systemd:
name: maintenance-docker-heal.cymais.service
state: restarted
daemon_reload: yes

View File

@ -1 +0,0 @@
heal_docker: "{{path_administrator_scripts}}maintenance-docker-heal/"

View File

@ -1,5 +0,0 @@
- name: "reload maintenance-docker-restart.cymais.service"
systemd:
name: maintenance-docker-restart.cymais.service
enabled: yes
daemon_reload: yes

View File

@ -1,2 +0,0 @@
restart_docker_folder: "{{path_administrator_scripts}}maintenance-docker-restart/"
restart_docker_script: "{{restart_docker_folder}}maintenance-docker-restart.py"

View File

@ -1,5 +0,0 @@
- name: "reload maintenance-docker-storage-optimizer.cymais.service"
systemd:
name: maintenance-docker-storage-optimizer.cymais.service
state: reloaded
daemon_reload: yes

View File

@ -1,22 +0,0 @@
- name: "create {{storage_optimizer_directory}}"
file:
path: "{{storage_optimizer_directory}}"
state: directory
mode: 0755
- name: create maintenance-docker-storage-optimizer.cymais.service
template:
src: maintenance-docker-storage-optimizer.service.j2
dest: /etc/systemd/system/maintenance-docker-storage-optimizer.cymais.service
notify: reload maintenance-docker-storage-optimizer.cymais.service
- name: create maintenance-docker-storage-optimizer.py
copy:
src: maintenance-docker-storage-optimizer.py
dest: "{{storage_optimizer_script}}"
mode: 0755
- name: "optimize storage performance"
systemd:
name: maintenance-docker-storage-optimizer.cymais.service
state: started

View File

@ -27,4 +27,4 @@ galaxy_info:
issue_tracker_url: "https://s.veen.world/cymaisissues" issue_tracker_url: "https://s.veen.world/cymaisissues"
documentation: "https://s.veen.world/cymais" documentation: "https://s.veen.world/cymais"
dependencies: dependencies:
- maintenance-lock - maint-lock

View File

@ -148,4 +148,4 @@
- name: setup swapfile hosts - name: setup swapfile hosts
when: ('swapfile' | application_allowed(group_names, allowed_applications)) when: ('swapfile' | application_allowed(group_names, allowed_applications))
include_role: include_role:
name: maintenance-swapfile name: maint-swapfile

View File

@ -9,7 +9,7 @@
- mon-bot-disc-space - mon-bot-disc-space
- cleanup-disc-space - cleanup-disc-space
- mon-bot-btrfs - mon-bot-btrfs
- maintenance-btrfs-auto-balancer - maint-btrfs-auto-balancer
- name: "Integrate Docker Role includes" - name: "Integrate Docker Role includes"
include_tasks: "./tasks/utils/web-app-roles.yml" include_tasks: "./tasks/utils/web-app-roles.yml"

View File

@ -1,6 +1,6 @@
- name: optimize storage performance - name: optimize storage performance
include_role: include_role:
name: maintenance-docker-storage-optimizer name: maint-docker-storage-optimizer
when: ('storage-optimizer' | application_allowed(group_names, allowed_applications)) when: ('storage-optimizer' | application_allowed(group_names, allowed_applications))
- name: Cleanup Docker Anonymous Volumes - name: Cleanup Docker Anonymous Volumes

View File

@ -8,7 +8,7 @@ import sys
def load_optimizer_module(): def load_optimizer_module():
module_path = os.path.abspath(os.path.join( module_path = os.path.abspath(os.path.join(
os.path.dirname(__file__), os.path.dirname(__file__),
'..', "..", "..","..",'roles', 'maintenance-docker-storage-optimizer', 'files', 'maintenance-docker-storage-optimizer.py' '..', "..", "..","..",'roles', 'maint-docker-storage-optimizer', 'files', 'maint-docker-storage-optimizer.py'
)) ))
spec = importlib.util.spec_from_file_location('storage_optimizer', module_path) spec = importlib.util.spec_from_file_location('storage_optimizer', module_path)
optimizer = importlib.util.module_from_spec(spec) optimizer = importlib.util.module_from_spec(spec)