From f548faa80f04d800c57ebddfd4cd6b8277cfadf6 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Wed, 9 Jul 2025 03:45:02 +0200 Subject: [PATCH] Shorted cleanup- to cln- --- docs/guides/administrator/Readme.md | 2 +- group_vars/all/05_maintenace.yml | 6 +++--- roles/README.md | 4 ++-- roles/bkp-data-to-usb/meta/main.yml | 2 +- .../templates/bkp-data-to-usb.service.j2 | 2 +- roles/bkp-directory-validator/README.md | 2 +- roles/bkp-docker-to-local/README.md | 2 +- roles/bkp-docker-to-local/meta/main.yml | 2 +- .../bkp-docker-to-local-everything.service.j2 | 2 +- .../templates/bkp-docker-to-local.service.j2 | 2 +- roles/bkp-provider/README.md | 2 +- roles/bkp-provider/meta/main.yml | 2 +- roles/bkp-remote-to-local/README.md | 2 +- roles/bkp-remote-to-local/meta/main.yml | 4 ++-- .../templates/bkp-remote-to-local.service.j2 | 2 +- roles/cleanup-backups-service/handlers/main.yml | 5 ----- roles/cleanup-backups-service/vars/main.yml | 1 - roles/cleanup-certs/handlers/main.yml | 6 ------ roles/cleanup-disc-space/handlers/main.yml | 5 ----- roles/cleanup-disc-space/vars/main.yml | 1 - .../handlers/main.yml | 5 ----- .../README.md | 0 .../files/cln-backups.py} | 0 roles/cln-backups-service/handlers/main.yml | 5 +++++ .../meta/main.yml | 0 .../tasks/main.yml | 14 +++++++------- .../templates/cln-backups.service.j2} | 2 +- roles/cln-backups-service/vars/main.yml | 1 + .../README.md | 6 +++--- .../meta/main.yml | 4 ++-- .../tasks/main.yml | 4 ++-- roles/{cleanup-certs => cln-certs}/README.md | 6 +++--- roles/cln-certs/handlers/main.yml | 6 ++++++ roles/{cleanup-certs => cln-certs}/meta/main.yml | 0 roles/{cleanup-certs => cln-certs}/tasks/main.yml | 8 ++++---- .../templates/cln-certs.service.j2} | 0 .../README.md | 0 roles/cln-disc-space/handlers/main.yml | 5 +++++ .../meta/main.yml | 0 .../tasks/main.yml | 14 +++++++------- .../templates/cln-disc-space.service.j2} | 2 +- .../templates/cln-disc-space.sh.j2} | 2 +- roles/cln-disc-space/vars/main.yml | 1 + .../README.md | 0 .../meta/main.yml | 0 .../tasks/main.yml | 0 roles/{cleanup-domains => cln-domains}/README.md | 2 +- .../{cleanup-domains => cln-domains}/meta/main.yml | 0 .../tasks/main.yml | 0 .../tasks/remove_deprecated_nginx_configs.yml | 0 .../README.md | 4 ++-- roles/cln-failed-docker-backups/handlers/main.yml | 5 +++++ .../meta/main.yml | 0 .../tasks/main.yml | 14 +++++++------- .../cln-failed-docker-backups.service.j2} | 0 roles/webserver-https/README.md | 2 +- roles/webserver-https/meta/main.yml | 2 +- roles/webserver-tls-renew/meta/main.yml | 2 +- tasks/plays/02_server.yml | 2 +- tasks/plays/03_destructor.yml | 2 +- 60 files changed, 88 insertions(+), 88 deletions(-) delete mode 100644 roles/cleanup-backups-service/handlers/main.yml delete mode 100644 roles/cleanup-backups-service/vars/main.yml delete mode 100644 roles/cleanup-certs/handlers/main.yml delete mode 100644 roles/cleanup-disc-space/handlers/main.yml delete mode 100644 roles/cleanup-disc-space/vars/main.yml delete mode 100644 roles/cleanup-failed-docker-backups/handlers/main.yml rename roles/{cleanup-backups-service => cln-backups-service}/README.md (100%) rename roles/{cleanup-backups-service/files/cleanup-backups.py => cln-backups-service/files/cln-backups.py} (100%) create mode 100644 roles/cln-backups-service/handlers/main.yml rename roles/{cleanup-backups-service => cln-backups-service}/meta/main.yml (100%) rename roles/{cleanup-backups-service => cln-backups-service}/tasks/main.yml (67%) rename roles/{cleanup-backups-service/templates/cleanup-backups.service.j2 => cln-backups-service/templates/cln-backups.service.j2} (76%) create mode 100644 roles/cln-backups-service/vars/main.yml rename roles/{cleanup-backups-timer => cln-backups-timer}/README.md (71%) rename roles/{cleanup-backups-timer => cln-backups-timer}/meta/main.yml (86%) rename roles/{cleanup-backups-timer => cln-backups-timer}/tasks/main.yml (84%) rename roles/{cleanup-certs => cln-certs}/README.md (87%) create mode 100644 roles/cln-certs/handlers/main.yml rename roles/{cleanup-certs => cln-certs}/meta/main.yml (100%) rename roles/{cleanup-certs => cln-certs}/tasks/main.yml (78%) rename roles/{cleanup-certs/templates/cleanup-certs.service.j2 => cln-certs/templates/cln-certs.service.j2} (100%) rename roles/{cleanup-disc-space => cln-disc-space}/README.md (100%) create mode 100644 roles/cln-disc-space/handlers/main.yml rename roles/{cleanup-disc-space => cln-disc-space}/meta/main.yml (100%) rename roles/{cleanup-disc-space => cln-disc-space}/tasks/main.yml (56%) rename roles/{cleanup-disc-space/templates/cleanup-disc-space.service.j2 => cln-disc-space/templates/cln-disc-space.service.j2} (74%) rename roles/{cleanup-disc-space/templates/cleanup-disc-space.sh.j2 => cln-disc-space/templates/cln-disc-space.sh.j2} (90%) create mode 100644 roles/cln-disc-space/vars/main.yml rename roles/{cleanup-docker-anonymous-volumes => cln-docker-anonymous-volumes}/README.md (100%) rename roles/{cleanup-docker-anonymous-volumes => cln-docker-anonymous-volumes}/meta/main.yml (100%) rename roles/{cleanup-docker-anonymous-volumes => cln-docker-anonymous-volumes}/tasks/main.yml (100%) rename roles/{cleanup-domains => cln-domains}/README.md (98%) rename roles/{cleanup-domains => cln-domains}/meta/main.yml (100%) rename roles/{cleanup-domains => cln-domains}/tasks/main.yml (100%) rename roles/{cleanup-domains => cln-domains}/tasks/remove_deprecated_nginx_configs.yml (100%) rename roles/{cleanup-failed-docker-backups => cln-failed-docker-backups}/README.md (74%) create mode 100644 roles/cln-failed-docker-backups/handlers/main.yml rename roles/{cleanup-failed-docker-backups => cln-failed-docker-backups}/meta/main.yml (100%) rename roles/{cleanup-failed-docker-backups => cln-failed-docker-backups}/tasks/main.yml (74%) rename roles/{cleanup-failed-docker-backups/templates/cleanup-failed-docker-backups.service.j2 => cln-failed-docker-backups/templates/cln-failed-docker-backups.service.j2} (100%) diff --git a/docs/guides/administrator/Readme.md b/docs/guides/administrator/Readme.md index 5a45e63a..eb22498b 100644 --- a/docs/guides/administrator/Readme.md +++ b/docs/guides/administrator/Readme.md @@ -17,6 +17,6 @@ Follow these guides to install and configure CyMaIS: ## Managing & Updating CyMaIS πŸ”„ - 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`. -- Automate system maintenance with `maint-lock`, `cleanup-backups-service`, and `maint-docker-restart`. +- Automate system maintenance with `maint-lock`, `cln-backups-service`, and `maint-docker-restart`. For more details, refer to the specific guides above. \ No newline at end of file diff --git a/group_vars/all/05_maintenace.yml b/group_vars/all/05_maintenace.yml index c57a518b..ec450726 100644 --- a/group_vars/all/05_maintenace.yml +++ b/group_vars/all/05_maintenace.yml @@ -20,9 +20,9 @@ system_maintenance_backup_services: ### Defined Services for System Cleanup system_maintenance_cleanup_services: - - "cleanup-backups" - - "cleanup-disc-space" - - "cleanup-failed-docker-backups" + - "cln-backups" + - "cln-disc-space" + - "cln-failed-docker-backups" ### Services that Manipulate the System system_maintenance_manipulation_services: diff --git a/roles/README.md b/roles/README.md index 25d468a3..571a362d 100644 --- a/roles/README.md +++ b/roles/README.md @@ -78,7 +78,7 @@ For a complete list of role categories and detailed definitions, see: - **maint-docker-*** Automated recovery and restarts for Docker Compose workloads. -- **cleanup-*** +- **cln-*** Housekeeping tasks (old backups, certs, log rotation). --- @@ -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: > `core-`, `generic-`, `desk-`, `webserver-`, `web-service-`, `web-app-`, -> `network-`, `service-`, `monitor-`, `alert-`, `maint-`, `cleanup-`, +> `network-`, `service-`, `monitor-`, `alert-`, `maint-`, `cln-`, > `bkp-`, `update-`, `pkgmgr-`, `user-`. --- diff --git a/roles/bkp-data-to-usb/meta/main.yml b/roles/bkp-data-to-usb/meta/main.yml index 7414234b..e4fa7ef4 100644 --- a/roles/bkp-data-to-usb/meta/main.yml +++ b/roles/bkp-data-to-usb/meta/main.yml @@ -23,5 +23,5 @@ galaxy_info: issue_tracker_url: https://s.veen.world/cymaisissues documentation: https://s.veen.world/cymais dependencies: - - cleanup-backups-service + - cln-backups-service - maint-lock diff --git a/roles/bkp-data-to-usb/templates/bkp-data-to-usb.service.j2 b/roles/bkp-data-to-usb/templates/bkp-data-to-usb.service.j2 index 85bb33c8..f6a5b76a 100644 --- a/roles/bkp-data-to-usb/templates/bkp-data-to-usb.service.j2 +++ b/roles/bkp-data-to-usb/templates/bkp-data-to-usb.service.j2 @@ -6,7 +6,7 @@ OnFailure=alert-compose.cymais@%n.service [Service] Type=oneshot ExecStart=/bin/python {{ backup_to_usb_script_path }} {{backup_to_usb_source}} {{backup_to_usb_destination}} -ExecStartPost=/bin/systemctl start cleanup-backups.cymais.service +ExecStartPost=/bin/systemctl start cln-backups.cymais.service [Install] WantedBy=multi-user.target \ No newline at end of file diff --git a/roles/bkp-directory-validator/README.md b/roles/bkp-directory-validator/README.md index d2c6da4d..e3e4c0fb 100644 --- a/roles/bkp-directory-validator/README.md +++ b/roles/bkp-directory-validator/README.md @@ -2,7 +2,7 @@ ## Description -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. +This Ansible role installs the [directory-validator](https://github.com/kevinveenbirkenbach/directory-validator.git). It is used by the bkp-docker-to-local and cln-failed-docker-backups roles to verify whether backups have been successfully created. ## Overview diff --git a/roles/bkp-docker-to-local/README.md b/roles/bkp-docker-to-local/README.md index 2d98321f..064b32cb 100644 --- a/roles/bkp-docker-to-local/README.md +++ b/roles/bkp-docker-to-local/README.md @@ -8,7 +8,7 @@ This Ansible role automates the process of backing up Docker volumes to a local 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: - [bkp-directory-validator](../bkp-directory-validator/) – Validates backup directories. -- [cleanup-failed-docker-backups](../cleanup-failed-docker-backups/) – Cleans up unsuccessful backup attempts. +- [cln-failed-docker-backups](../cln-failed-docker-backups/) – Cleans up unsuccessful backup attempts. - [generic-timer](../generic-timer/) – Schedules recurring backup tasks. - [bkp-provider](../bkp-provider/) – Manages backup sources. - [maint-lock](../maint-lock/) – Ensures coordinated maintenance operations. diff --git a/roles/bkp-docker-to-local/meta/main.yml b/roles/bkp-docker-to-local/meta/main.yml index bdc18389..65ce5f4e 100644 --- a/roles/bkp-docker-to-local/meta/main.yml +++ b/roles/bkp-docker-to-local/meta/main.yml @@ -25,6 +25,6 @@ galaxy_info: dependencies: - bkp-provider - alert-compose - - cleanup-failed-docker-backups + - cln-failed-docker-backups - maint-lock - bkp-directory-validator \ No newline at end of file diff --git a/roles/bkp-docker-to-local/templates/bkp-docker-to-local-everything.service.j2 b/roles/bkp-docker-to-local/templates/bkp-docker-to-local-everything.service.j2 index fcc0354b..16856972 100644 --- a/roles/bkp-docker-to-local/templates/bkp-docker-to-local-everything.service.j2 +++ b/roles/bkp-docker-to-local/templates/bkp-docker-to-local-everything.service.j2 @@ -1,6 +1,6 @@ [Unit] Description=backup docker volumes to local folder -OnFailure=alert-compose.cymais@%n.service cleanup-failed-docker-backups.cymais.service +OnFailure=alert-compose.cymais@%n.service cln-failed-docker-backups.cymais.service [Service] Type=oneshot diff --git a/roles/bkp-docker-to-local/templates/bkp-docker-to-local.service.j2 b/roles/bkp-docker-to-local/templates/bkp-docker-to-local.service.j2 index 1c3ea542..aad4e82c 100644 --- a/roles/bkp-docker-to-local/templates/bkp-docker-to-local.service.j2 +++ b/roles/bkp-docker-to-local/templates/bkp-docker-to-local.service.j2 @@ -1,6 +1,6 @@ [Unit] Description=backup docker volumes to local folder -OnFailure=alert-compose.cymais@%n.service cleanup-failed-docker-backups.cymais.service +OnFailure=alert-compose.cymais@%n.service cln-failed-docker-backups.cymais.service [Service] Type=oneshot diff --git a/roles/bkp-provider/README.md b/roles/bkp-provider/README.md index 4dfb0bf6..9bd3ff4b 100644 --- a/roles/bkp-provider/README.md +++ b/roles/bkp-provider/README.md @@ -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 [bkp-provider-user](../bkp-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 [cln-backups-timer](../cln-backups-timer/README.md) roles. - Lays the foundation for secure and extensible backup operations. ## Purpose diff --git a/roles/bkp-provider/meta/main.yml b/roles/bkp-provider/meta/main.yml index cbbf9ed0..154b6405 100644 --- a/roles/bkp-provider/meta/main.yml +++ b/roles/bkp-provider/meta/main.yml @@ -24,4 +24,4 @@ galaxy_info: documentation: "https://s.veen.world/cymais" dependencies: - bkp-provider-user - - cleanup-backups-timer + - cln-backups-timer diff --git a/roles/bkp-remote-to-local/README.md b/roles/bkp-remote-to-local/README.md index b88158a4..ec9f0b6f 100644 --- a/roles/bkp-remote-to-local/README.md +++ b/roles/bkp-remote-to-local/README.md @@ -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. - **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 bkp-directory-validator, cleanup-failed-docker-backups, generic-timer, bkp-provider, and maint-lock. +- **Integration with Other Roles:** Works alongside roles like bkp-directory-validator, cln-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 diff --git a/roles/bkp-remote-to-local/meta/main.yml b/roles/bkp-remote-to-local/meta/main.yml index f162066e..929732bd 100644 --- a/roles/bkp-remote-to-local/meta/main.yml +++ b/roles/bkp-remote-to-local/meta/main.yml @@ -27,7 +27,7 @@ galaxy_info: dependencies: - generic-git - alert-compose - - cleanup-backups-timer - - cleanup-failed-docker-backups + - cln-backups-timer + - cln-failed-docker-backups - maint-lock - user-root diff --git a/roles/bkp-remote-to-local/templates/bkp-remote-to-local.service.j2 b/roles/bkp-remote-to-local/templates/bkp-remote-to-local.service.j2 index e9795ccf..cbe789b8 100644 --- a/roles/bkp-remote-to-local/templates/bkp-remote-to-local.service.j2 +++ b/roles/bkp-remote-to-local/templates/bkp-remote-to-local.service.j2 @@ -1,6 +1,6 @@ [Unit] Description=pull remote backups -OnFailure=alert-compose.cymais@%n.service cleanup-failed-docker-backups.cymais.service +OnFailure=alert-compose.cymais@%n.service cln-failed-docker-backups.cymais.service [Service] Type=oneshot diff --git a/roles/cleanup-backups-service/handlers/main.yml b/roles/cleanup-backups-service/handlers/main.yml deleted file mode 100644 index 1f0af609..00000000 --- a/roles/cleanup-backups-service/handlers/main.yml +++ /dev/null @@ -1,5 +0,0 @@ -- name: "reload cleanup-backups.cymais.service" - systemd: - name: cleanup-backups.cymais.service - enabled: yes - daemon_reload: yes diff --git a/roles/cleanup-backups-service/vars/main.yml b/roles/cleanup-backups-service/vars/main.yml deleted file mode 100644 index 3490e588..00000000 --- a/roles/cleanup-backups-service/vars/main.yml +++ /dev/null @@ -1 +0,0 @@ -cleanup_backups_directory: "{{path_administrator_scripts}}cleanup-backups/" \ No newline at end of file diff --git a/roles/cleanup-certs/handlers/main.yml b/roles/cleanup-certs/handlers/main.yml deleted file mode 100644 index e2416e87..00000000 --- a/roles/cleanup-certs/handlers/main.yml +++ /dev/null @@ -1,6 +0,0 @@ -- name: "Reload and restart cleanup-certs.cymais.service" - systemd: - name: cleanup-certs.cymais.service - enabled: yes - daemon_reload: yes - state: restarted \ No newline at end of file diff --git a/roles/cleanup-disc-space/handlers/main.yml b/roles/cleanup-disc-space/handlers/main.yml deleted file mode 100644 index 8c4f180c..00000000 --- a/roles/cleanup-disc-space/handlers/main.yml +++ /dev/null @@ -1,5 +0,0 @@ -- name: "reload cleanup-disc-space.cymais.service" - systemd: - name: cleanup-disc-space.cymais.service - enabled: yes - daemon_reload: yes diff --git a/roles/cleanup-disc-space/vars/main.yml b/roles/cleanup-disc-space/vars/main.yml deleted file mode 100644 index 7a6c1430..00000000 --- a/roles/cleanup-disc-space/vars/main.yml +++ /dev/null @@ -1 +0,0 @@ -cleanup_disc_space_folder: "{{path_administrator_scripts}}cleanup-disc-space/" \ No newline at end of file diff --git a/roles/cleanup-failed-docker-backups/handlers/main.yml b/roles/cleanup-failed-docker-backups/handlers/main.yml deleted file mode 100644 index 69a7cc80..00000000 --- a/roles/cleanup-failed-docker-backups/handlers/main.yml +++ /dev/null @@ -1,5 +0,0 @@ -- name: "Reload cleanup-failed-docker-backups.cymais.service" - systemd: - name: cleanup-failed-docker-backups.cymais.service - enabled: yes - daemon_reload: yes \ No newline at end of file diff --git a/roles/cleanup-backups-service/README.md b/roles/cln-backups-service/README.md similarity index 100% rename from roles/cleanup-backups-service/README.md rename to roles/cln-backups-service/README.md diff --git a/roles/cleanup-backups-service/files/cleanup-backups.py b/roles/cln-backups-service/files/cln-backups.py similarity index 100% rename from roles/cleanup-backups-service/files/cleanup-backups.py rename to roles/cln-backups-service/files/cln-backups.py diff --git a/roles/cln-backups-service/handlers/main.yml b/roles/cln-backups-service/handlers/main.yml new file mode 100644 index 00000000..2c851ce3 --- /dev/null +++ b/roles/cln-backups-service/handlers/main.yml @@ -0,0 +1,5 @@ +- name: "reload cln-backups.cymais.service" + systemd: + name: cln-backups.cymais.service + enabled: yes + daemon_reload: yes diff --git a/roles/cleanup-backups-service/meta/main.yml b/roles/cln-backups-service/meta/main.yml similarity index 100% rename from roles/cleanup-backups-service/meta/main.yml rename to roles/cln-backups-service/meta/main.yml diff --git a/roles/cleanup-backups-service/tasks/main.yml b/roles/cln-backups-service/tasks/main.yml similarity index 67% rename from roles/cleanup-backups-service/tasks/main.yml rename to roles/cln-backups-service/tasks/main.yml index 401cc02d..9445055a 100644 --- a/roles/cleanup-backups-service/tasks/main.yml +++ b/roles/cln-backups-service/tasks/main.yml @@ -13,17 +13,17 @@ mode: 0755 when: run_once_cleanup_backups_service is not defined -- name: create cleanup-backups.py +- name: create cln-backups.py copy: - src: "cleanup-backups.py" - dest: "{{cleanup_backups_directory}}cleanup-backups.py" + src: "cln-backups.py" + dest: "{{cleanup_backups_directory}}cln-backups.py" when: run_once_cleanup_backups_service is not defined -- name: create cleanup-backups.cymais.service +- name: create cln-backups.cymais.service template: - src: "cleanup-backups.service.j2" - dest: "/etc/systemd/system/cleanup-backups.cymais.service" - notify: reload cleanup-backups.cymais.service + src: "cln-backups.service.j2" + dest: "/etc/systemd/system/cln-backups.cymais.service" + notify: reload cln-backups.cymais.service when: run_once_cleanup_backups_service is not defined - name: run the cleanup_backups_service tasks once diff --git a/roles/cleanup-backups-service/templates/cleanup-backups.service.j2 b/roles/cln-backups-service/templates/cln-backups.service.j2 similarity index 76% rename from roles/cleanup-backups-service/templates/cleanup-backups.service.j2 rename to roles/cln-backups-service/templates/cln-backups.service.j2 index 3d7d96fb..96d6e3ac 100644 --- a/roles/cleanup-backups-service/templates/cleanup-backups.service.j2 +++ b/roles/cln-backups-service/templates/cln-backups.service.j2 @@ -5,4 +5,4 @@ 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 {{system_maintenance_cleanup_services| join(' ') }} --timeout "{{system_maintenance_lock_timeout_backup_services}}"' -ExecStart=/bin/sh -c '/usr/bin/python {{cleanup_backups_directory}}cleanup-backups.py --backups-folder-path {{backups_folder_path}} --maximum-backup-size-percent {{size_percent_maximum_backup}}' \ No newline at end of file +ExecStart=/bin/sh -c '/usr/bin/python {{cleanup_backups_directory}}cln-backups.py --backups-folder-path {{backups_folder_path}} --maximum-backup-size-percent {{size_percent_maximum_backup}}' \ No newline at end of file diff --git a/roles/cln-backups-service/vars/main.yml b/roles/cln-backups-service/vars/main.yml new file mode 100644 index 00000000..1a35a217 --- /dev/null +++ b/roles/cln-backups-service/vars/main.yml @@ -0,0 +1 @@ +cleanup_backups_directory: "{{path_administrator_scripts}}cln-backups/" \ No newline at end of file diff --git a/roles/cleanup-backups-timer/README.md b/roles/cln-backups-timer/README.md similarity index 71% rename from roles/cleanup-backups-timer/README.md rename to roles/cln-backups-timer/README.md index aa0415f4..384503e5 100644 --- a/roles/cleanup-backups-timer/README.md +++ b/roles/cln-backups-timer/README.md @@ -2,13 +2,13 @@ ## Description -This role sets up a systemd timer to schedule the periodic cleanup of old backups. It leverages the cleanup-backups-service role to perform the actual cleanup operation. +This role sets up a systemd timer to schedule the periodic cleanup of old backups. It leverages the cln-backups-service role to perform the actual cleanup operation. ## Overview Optimized for automated maintenance, this role: - Sets a fact for the service name. -- Integrates with the [generic-timer](../generic-timer/README.md) role to schedule cleanup-backups tasks at defined intervals. +- Integrates with the [generic-timer](../generic-timer/README.md) role to schedule cln-backups tasks at defined intervals. ## Purpose @@ -17,5 +17,5 @@ The primary purpose of this role is to automate the scheduling of backup cleanup ## Features - **Timer Scheduling:** Configures a systemd timer to trigger the backup cleanup service. -- **Role Integration:** Works in conjunction with the cleanup-backups-service role. +- **Role Integration:** Works in conjunction with the cln-backups-service role. - **Idempotency:** Ensures the timer tasks execute only once per playbook run. diff --git a/roles/cleanup-backups-timer/meta/main.yml b/roles/cln-backups-timer/meta/main.yml similarity index 86% rename from roles/cleanup-backups-timer/meta/main.yml rename to roles/cln-backups-timer/meta/main.yml index ff5df25d..75ae5ccd 100644 --- a/roles/cleanup-backups-timer/meta/main.yml +++ b/roles/cln-backups-timer/meta/main.yml @@ -1,7 +1,7 @@ --- galaxy_info: author: "Kevin Veen-Birkenbach" - description: "Schedules periodic cleanup of old backups by configuring a systemd timer to trigger the cleanup-backups-service role." + description: "Schedules periodic cleanup of old backups by configuring a systemd timer to trigger the cln-backups-service role." license: "CyMaIS NonCommercial License (CNCL)" license_url: "https://s.veen.world/cncl" company: | @@ -22,4 +22,4 @@ galaxy_info: issue_tracker_url: "https://s.veen.world/cymaisissues" documentation: "https://s.veen.world/cymais" dependencies: - - cleanup-backups-service + - cln-backups-service diff --git a/roles/cleanup-backups-timer/tasks/main.yml b/roles/cln-backups-timer/tasks/main.yml similarity index 84% rename from roles/cleanup-backups-timer/tasks/main.yml rename to roles/cln-backups-timer/tasks/main.yml index 7fa96413..450fbafe 100644 --- a/roles/cleanup-backups-timer/tasks/main.yml +++ b/roles/cln-backups-timer/tasks/main.yml @@ -1,6 +1,6 @@ -- name: set service_name to cleanup-backups +- name: set service_name to cln-backups set_fact: - service_name: "cleanup-backups" + service_name: "cln-backups" when: run_once_cleanup_backups_timer is not defined - name: "include role for generic-timer for {{service_name}}" diff --git a/roles/cleanup-certs/README.md b/roles/cln-certs/README.md similarity index 87% rename from roles/cleanup-certs/README.md rename to roles/cln-certs/README.md index d936bece..8e602179 100644 --- a/roles/cleanup-certs/README.md +++ b/roles/cln-certs/README.md @@ -7,7 +7,7 @@ This Ansible role automates the detection, revocation and deletion of unused Let ## Overview - Installs the `certreap` cleanup tool using the `pkgmgr-install` role -- Deploys and configures a `cleanup-certs.cymais.service` systemd unit +- Deploys and configures a `cln-certs.cymais.service` systemd unit - (Optionally) Sets up a recurring cleanup via a systemd timer using the `generic-timer` role - Integrates with `alert-compose` to send failure notifications - Ensures idempotent execution with a `run_once_cleanup_certs` flag @@ -18,7 +18,7 @@ This Ansible role automates the detection, revocation and deletion of unused Let Uses `pkgmgr-install` to install the `certreap` binary. - **Systemd Service Configuration** - Deploys `cleanup-certs.cymais.service` and reloads/restarts it on changes. + Deploys `cln-certs.cymais.service` and reloads/restarts it on changes. - **Systemd Timer Scheduling** Optionally wires in a timer via the `generic-timer` role, controlled by the `on_calendar_cleanup_certs` variable. @@ -27,7 +27,7 @@ This Ansible role automates the detection, revocation and deletion of unused Let Prevents multiple runs in one play by setting a `run_once_cleanup_certs` fact. - **Failure Notification** - Triggers `alert-compose.cymais@cleanup-certs.cymais.service` on failure. + Triggers `alert-compose.cymais@cln-certs.cymais.service` on failure. ## Further Resources diff --git a/roles/cln-certs/handlers/main.yml b/roles/cln-certs/handlers/main.yml new file mode 100644 index 00000000..47b295a5 --- /dev/null +++ b/roles/cln-certs/handlers/main.yml @@ -0,0 +1,6 @@ +- name: "Reload and restart cln-certs.cymais.service" + systemd: + name: cln-certs.cymais.service + enabled: yes + daemon_reload: yes + state: restarted \ No newline at end of file diff --git a/roles/cleanup-certs/meta/main.yml b/roles/cln-certs/meta/main.yml similarity index 100% rename from roles/cleanup-certs/meta/main.yml rename to roles/cln-certs/meta/main.yml diff --git a/roles/cleanup-certs/tasks/main.yml b/roles/cln-certs/tasks/main.yml similarity index 78% rename from roles/cleanup-certs/tasks/main.yml rename to roles/cln-certs/tasks/main.yml index 49ce6eec..0509e770 100644 --- a/roles/cleanup-certs/tasks/main.yml +++ b/roles/cln-certs/tasks/main.yml @@ -5,11 +5,11 @@ package_name: certreap when: run_once_cleanup_certs is not defined -- name: configure cleanup-certs.cymais.service +- name: configure cln-certs.cymais.service template: - src: cleanup-certs.service.j2 - dest: /etc/systemd/system/cleanup-certs.cymais.service - notify: Reload and restart cleanup-certs.cymais.service + src: cln-certs.service.j2 + dest: /etc/systemd/system/cln-certs.cymais.service + notify: Reload and restart cln-certs.cymais.service when: run_once_cleanup_certs is not defined - name: set service_name to the name of the current role diff --git a/roles/cleanup-certs/templates/cleanup-certs.service.j2 b/roles/cln-certs/templates/cln-certs.service.j2 similarity index 100% rename from roles/cleanup-certs/templates/cleanup-certs.service.j2 rename to roles/cln-certs/templates/cln-certs.service.j2 diff --git a/roles/cleanup-disc-space/README.md b/roles/cln-disc-space/README.md similarity index 100% rename from roles/cleanup-disc-space/README.md rename to roles/cln-disc-space/README.md diff --git a/roles/cln-disc-space/handlers/main.yml b/roles/cln-disc-space/handlers/main.yml new file mode 100644 index 00000000..d74c67fa --- /dev/null +++ b/roles/cln-disc-space/handlers/main.yml @@ -0,0 +1,5 @@ +- name: "reload cln-disc-space.cymais.service" + systemd: + name: cln-disc-space.cymais.service + enabled: yes + daemon_reload: yes diff --git a/roles/cleanup-disc-space/meta/main.yml b/roles/cln-disc-space/meta/main.yml similarity index 100% rename from roles/cleanup-disc-space/meta/main.yml rename to roles/cln-disc-space/meta/main.yml diff --git a/roles/cleanup-disc-space/tasks/main.yml b/roles/cln-disc-space/tasks/main.yml similarity index 56% rename from roles/cleanup-disc-space/tasks/main.yml rename to roles/cln-disc-space/tasks/main.yml index b9f1bab5..fd0ec025 100644 --- a/roles/cleanup-disc-space/tasks/main.yml +++ b/roles/cln-disc-space/tasks/main.yml @@ -4,16 +4,16 @@ state: directory mode: 0755 -- name: create cleanup-disc-space.sh +- name: create cln-disc-space.sh template: - src: cleanup-disc-space.sh.j2 - dest: "{{cleanup_disc_space_folder}}cleanup-disc-space.sh" + src: cln-disc-space.sh.j2 + dest: "{{cleanup_disc_space_folder}}cln-disc-space.sh" -- name: create cleanup-disc-space.cymais.service +- name: create cln-disc-space.cymais.service template: - src: cleanup-disc-space.service.j2 - dest: /etc/systemd/system/cleanup-disc-space.cymais.service - notify: reload cleanup-disc-space.cymais.service + src: cln-disc-space.service.j2 + dest: /etc/systemd/system/cln-disc-space.cymais.service + notify: reload cln-disc-space.cymais.service - name: set service_name to the name of the current role set_fact: diff --git a/roles/cleanup-disc-space/templates/cleanup-disc-space.service.j2 b/roles/cln-disc-space/templates/cln-disc-space.service.j2 similarity index 74% rename from roles/cleanup-disc-space/templates/cleanup-disc-space.service.j2 rename to roles/cln-disc-space/templates/cln-disc-space.service.j2 index 014438f7..87eec030 100644 --- a/roles/cleanup-disc-space/templates/cleanup-disc-space.service.j2 +++ b/roles/cln-disc-space/templates/cln-disc-space.service.j2 @@ -5,4 +5,4 @@ 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 {{system_maintenance_cleanup_services| join(' ') }} --timeout "{{system_maintenance_lock_timeout_backup_services}}"' -ExecStart=/bin/sh -c '/bin/bash {{cleanup_disc_space_folder}}cleanup-disc-space.sh {{size_percent_cleanup_disc_space}}' \ No newline at end of file +ExecStart=/bin/sh -c '/bin/bash {{cleanup_disc_space_folder}}cln-disc-space.sh {{size_percent_cleanup_disc_space}}' \ No newline at end of file diff --git a/roles/cleanup-disc-space/templates/cleanup-disc-space.sh.j2 b/roles/cln-disc-space/templates/cln-disc-space.sh.j2 similarity index 90% rename from roles/cleanup-disc-space/templates/cleanup-disc-space.sh.j2 rename to roles/cln-disc-space/templates/cln-disc-space.sh.j2 index d759080a..0a56741a 100644 --- a/roles/cleanup-disc-space/templates/cleanup-disc-space.sh.j2 +++ b/roles/cln-disc-space/templates/cln-disc-space.sh.j2 @@ -24,7 +24,7 @@ if [ "$force_freeing" = true ]; then {% if backups_folder_path is defined and size_percent_maximum_backup is defined %} echo "cleaning up backups" && - python {{path_administrator_scripts}}cleanup-backups/cleanup-backups.py --backups-folder-path {{backups_folder_path}} --maximum-backup-size-percent {{size_percent_maximum_backup}} || exit 2 + python {{path_administrator_scripts}}cln-backups/cln-backups.py --backups-folder-path {{backups_folder_path}} --maximum-backup-size-percent {{size_percent_maximum_backup}} || exit 2 {% endif %} if pacman -Qs $package > /dev/null ; then diff --git a/roles/cln-disc-space/vars/main.yml b/roles/cln-disc-space/vars/main.yml new file mode 100644 index 00000000..4af6e8e3 --- /dev/null +++ b/roles/cln-disc-space/vars/main.yml @@ -0,0 +1 @@ +cleanup_disc_space_folder: "{{path_administrator_scripts}}cln-disc-space/" \ No newline at end of file diff --git a/roles/cleanup-docker-anonymous-volumes/README.md b/roles/cln-docker-anonymous-volumes/README.md similarity index 100% rename from roles/cleanup-docker-anonymous-volumes/README.md rename to roles/cln-docker-anonymous-volumes/README.md diff --git a/roles/cleanup-docker-anonymous-volumes/meta/main.yml b/roles/cln-docker-anonymous-volumes/meta/main.yml similarity index 100% rename from roles/cleanup-docker-anonymous-volumes/meta/main.yml rename to roles/cln-docker-anonymous-volumes/meta/main.yml diff --git a/roles/cleanup-docker-anonymous-volumes/tasks/main.yml b/roles/cln-docker-anonymous-volumes/tasks/main.yml similarity index 100% rename from roles/cleanup-docker-anonymous-volumes/tasks/main.yml rename to roles/cln-docker-anonymous-volumes/tasks/main.yml diff --git a/roles/cleanup-domains/README.md b/roles/cln-domains/README.md similarity index 98% rename from roles/cleanup-domains/README.md rename to roles/cln-domains/README.md index baa1521c..61232452 100644 --- a/roles/cleanup-domains/README.md +++ b/roles/cln-domains/README.md @@ -1,4 +1,4 @@ -# cleanup-domains +# cln-domains ## Description diff --git a/roles/cleanup-domains/meta/main.yml b/roles/cln-domains/meta/main.yml similarity index 100% rename from roles/cleanup-domains/meta/main.yml rename to roles/cln-domains/meta/main.yml diff --git a/roles/cleanup-domains/tasks/main.yml b/roles/cln-domains/tasks/main.yml similarity index 100% rename from roles/cleanup-domains/tasks/main.yml rename to roles/cln-domains/tasks/main.yml diff --git a/roles/cleanup-domains/tasks/remove_deprecated_nginx_configs.yml b/roles/cln-domains/tasks/remove_deprecated_nginx_configs.yml similarity index 100% rename from roles/cleanup-domains/tasks/remove_deprecated_nginx_configs.yml rename to roles/cln-domains/tasks/remove_deprecated_nginx_configs.yml diff --git a/roles/cleanup-failed-docker-backups/README.md b/roles/cln-failed-docker-backups/README.md similarity index 74% rename from roles/cleanup-failed-docker-backups/README.md rename to roles/cln-failed-docker-backups/README.md index 5a9badd6..1052b713 100644 --- a/roles/cleanup-failed-docker-backups/README.md +++ b/roles/cln-failed-docker-backups/README.md @@ -2,12 +2,12 @@ ## Description -This role cleans up failed Docker backups by pulling a [Git repository](https://github.com/kevinveenbirkenbach/cleanup-failed-docker-backups) that contains cleanup scripts and configuring a systemd service to execute them. It ensures that failed or incomplete backups are removed to free up disk space and maintain a healthy backup environment. +This role cleans up failed Docker backups by pulling a [Git repository](https://github.com/kevinveenbirkenbach/cln-failed-docker-backups) that contains cleanup scripts and configuring a systemd service to execute them. It ensures that failed or incomplete backups are removed to free up disk space and maintain a healthy backup environment. ## Overview Optimized for backup maintenance, this role: -- Clones the cleanup-failed-docker-backups repository. +- Clones the cln-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 bkp-directory-validator role for additional verification. diff --git a/roles/cln-failed-docker-backups/handlers/main.yml b/roles/cln-failed-docker-backups/handlers/main.yml new file mode 100644 index 00000000..1c0cd478 --- /dev/null +++ b/roles/cln-failed-docker-backups/handlers/main.yml @@ -0,0 +1,5 @@ +- name: "Reload cln-failed-docker-backups.cymais.service" + systemd: + name: cln-failed-docker-backups.cymais.service + enabled: yes + daemon_reload: yes \ No newline at end of file diff --git a/roles/cleanup-failed-docker-backups/meta/main.yml b/roles/cln-failed-docker-backups/meta/main.yml similarity index 100% rename from roles/cleanup-failed-docker-backups/meta/main.yml rename to roles/cln-failed-docker-backups/meta/main.yml diff --git a/roles/cleanup-failed-docker-backups/tasks/main.yml b/roles/cln-failed-docker-backups/tasks/main.yml similarity index 74% rename from roles/cleanup-failed-docker-backups/tasks/main.yml rename to roles/cln-failed-docker-backups/tasks/main.yml index 6107055a..00e41885 100644 --- a/roles/cleanup-failed-docker-backups/tasks/main.yml +++ b/roles/cln-failed-docker-backups/tasks/main.yml @@ -2,26 +2,26 @@ include_role: name: pkgmgr-install vars: - package_name: cleanup-failed-docker-backups + package_name: cln-failed-docker-backups when: run_once_cleanup_failed_docker_backups is not defined - name: Retrieve bkp-docker-to-local path from pkgmgr - command: pkgmgr path cleanup-failed-docker-backups + command: pkgmgr path cln-failed-docker-backups register: pkgmgr_output changed_when: false when: run_once_cleanup_failed_docker_backups is not defined - name: Set fact for backup_docker_to_local_cleanup_script set_fact: - backup_docker_to_local_cleanup_script: "{{ pkgmgr_output.stdout.rstrip('/') ~ '/cleanup-all.sh' }}" + backup_docker_to_local_cleanup_script: "{{ pkgmgr_output.stdout.rstrip('/') ~ '/cln-all.sh' }}" changed_when: false when: run_once_cleanup_failed_docker_backups is not defined -- name: configure cleanup-failed-docker-backups.cymais.service +- name: configure cln-failed-docker-backups.cymais.service template: - src: cleanup-failed-docker-backups.service.j2 - dest: /etc/systemd/system/cleanup-failed-docker-backups.cymais.service - notify: Reload cleanup-failed-docker-backups.cymais.service + src: cln-failed-docker-backups.service.j2 + dest: /etc/systemd/system/cln-failed-docker-backups.cymais.service + notify: Reload cln-failed-docker-backups.cymais.service when: run_once_cleanup_failed_docker_backups is not defined - name: set service_name to the name of the current role diff --git a/roles/cleanup-failed-docker-backups/templates/cleanup-failed-docker-backups.service.j2 b/roles/cln-failed-docker-backups/templates/cln-failed-docker-backups.service.j2 similarity index 100% rename from roles/cleanup-failed-docker-backups/templates/cleanup-failed-docker-backups.service.j2 rename to roles/cln-failed-docker-backups/templates/cln-failed-docker-backups.service.j2 diff --git a/roles/webserver-https/README.md b/roles/webserver-https/README.md index 3087d225..86921a26 100644 --- a/roles/webserver-https/README.md +++ b/roles/webserver-https/README.md @@ -16,7 +16,7 @@ This role is built on top of your existing `webserver-core` role, and it automat When you apply **webserver-https**, it will: 1. **Include** the `webserver-core` role to install and configure Nginx. -2. **Clean up** any stale vHost files under `cleanup-domains`. +2. **Clean up** any stale vHost files under `cln-domains`. 3. **Deploy** the Let’s Encrypt challenge-and-redirect snippet from `network-letsencrypt`. 4. **Reload** Nginx automatically when any template changes. diff --git a/roles/webserver-https/meta/main.yml b/roles/webserver-https/meta/main.yml index b68c6667..1c313afd 100644 --- a/roles/webserver-https/meta/main.yml +++ b/roles/webserver-https/meta/main.yml @@ -25,5 +25,5 @@ galaxy_info: dependencies: - webserver-core - - cleanup-domains + - cln-domains - network-letsencrypt \ No newline at end of file diff --git a/roles/webserver-tls-renew/meta/main.yml b/roles/webserver-tls-renew/meta/main.yml index 7743d17a..6c627a2c 100644 --- a/roles/webserver-tls-renew/meta/main.yml +++ b/roles/webserver-tls-renew/meta/main.yml @@ -30,4 +30,4 @@ dependencies: - generic-certbot - webserver-core - alert-compose - - cleanup-certs + - cln-certs diff --git a/tasks/plays/02_server.yml b/tasks/plays/02_server.yml index 497a1f3f..123fc4bf 100644 --- a/tasks/plays/02_server.yml +++ b/tasks/plays/02_server.yml @@ -7,7 +7,7 @@ - core-security - core-journalctl - mon-bot-disc-space - - cleanup-disc-space + - cln-disc-space - mon-bot-btrfs - maint-btrfs-auto-balancer diff --git a/tasks/plays/03_destructor.yml b/tasks/plays/03_destructor.yml index 49fb70e0..f9e0abd7 100644 --- a/tasks/plays/03_destructor.yml +++ b/tasks/plays/03_destructor.yml @@ -5,7 +5,7 @@ - name: Cleanup Docker Anonymous Volumes import_role: - name: cleanup-docker-anonymous-volumes + name: cln-docker-anonymous-volumes when: mode_cleanup | bool - name: Show all facts