From d9d6c8060a7efb9e860e0069062847f325afded9 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Thu, 16 Nov 2023 15:32:29 +0100 Subject: [PATCH] Renamed health services --- README.md | 4 ++-- playbook.yml | 4 ++-- roles/btrfs-health-check/handlers/main.yml | 12 ---------- roles/btrfs-health-check/tasks/main.yml | 22 ------------------- roles/disc-space-check/handlers/main.yml | 12 ---------- roles/disc-space-check/tasks/main.yml | 22 ------------------- .../templates/disc-space-check.service.j2 | 7 ------ roles/disc-space-check/vars/main.yml | 1 - roles/docker-health-check/handlers/main.yml | 12 ---------- roles/docker-health-check/tasks/main.yml | 20 ----------------- roles/docker-health-check/vars/main.yml | 1 - roles/docker/meta/main.yml | 2 +- .../README.md | 2 +- .../files/health-btrfs.sh} | 0 roles/health-btrfs/handlers/main.yml | 12 ++++++++++ .../meta/main.yml | 0 roles/health-btrfs/tasks/main.yml | 22 +++++++++++++++++++ .../templates/health-btrfs.service.j2} | 2 +- .../templates/health-btrfs.timer.j2} | 2 +- .../vars/main.yml | 2 +- .../README.md | 2 +- .../files/health-disc-space.sh} | 0 roles/health-disc-space/handlers/main.yml | 12 ++++++++++ .../meta/main.yml | 0 roles/health-disc-space/tasks/main.yml | 22 +++++++++++++++++++ .../templates/health-disc-space.service.j2 | 7 ++++++ .../templates/health-disc-space.timer.j2} | 2 +- roles/health-disc-space/vars/main.yml | 1 + .../files/health-docker.sh} | 0 roles/health-docker/handlers/main.yml | 12 ++++++++++ .../meta/main.yml | 0 roles/health-docker/tasks/main.yml | 20 +++++++++++++++++ .../templates/health-docker.service.j2} | 2 +- .../templates/health-docker.timer.j2} | 2 +- roles/health-docker/vars/main.yml | 1 + .../README.md | 2 +- .../files/health-journalctl.sh} | 0 roles/health-journalctl/handlers/main.yml | 13 +++++++++++ .../meta/main.yml | 0 roles/health-journalctl/tasks/main.yml | 22 +++++++++++++++++++ .../templates/health-journalctl.service.j2} | 2 +- .../templates/health-journalctl.timer.j2} | 2 +- roles/health-journalctl/vars/main.yml | 1 + .../journalctl-health-check/handlers/main.yml | 13 ----------- roles/journalctl-health-check/tasks/main.yml | 22 ------------------- roles/journalctl-health-check/vars/main.yml | 1 - roles/journalctl/meta/main.yml | 2 +- 47 files changed, 162 insertions(+), 162 deletions(-) delete mode 100644 roles/btrfs-health-check/handlers/main.yml delete mode 100644 roles/btrfs-health-check/tasks/main.yml delete mode 100644 roles/disc-space-check/handlers/main.yml delete mode 100644 roles/disc-space-check/tasks/main.yml delete mode 100644 roles/disc-space-check/templates/disc-space-check.service.j2 delete mode 100644 roles/disc-space-check/vars/main.yml delete mode 100644 roles/docker-health-check/handlers/main.yml delete mode 100644 roles/docker-health-check/tasks/main.yml delete mode 100644 roles/docker-health-check/vars/main.yml rename roles/{btrfs-health-check => health-btrfs}/README.md (93%) rename roles/{btrfs-health-check/files/btrfs-health-check.sh => health-btrfs/files/health-btrfs.sh} (100%) create mode 100644 roles/health-btrfs/handlers/main.yml rename roles/{btrfs-health-check => health-btrfs}/meta/main.yml (100%) create mode 100644 roles/health-btrfs/tasks/main.yml rename roles/{btrfs-health-check/templates/btrfs-health-check.service.j2 => health-btrfs/templates/health-btrfs.service.j2} (56%) rename roles/{btrfs-health-check/templates/btrfs-health-check.timer.j2 => health-btrfs/templates/health-btrfs.timer.j2} (77%) rename roles/{btrfs-health-check => health-btrfs}/vars/main.yml (75%) rename roles/{disc-space-check => health-disc-space}/README.md (63%) rename roles/{disc-space-check/files/disc-space-check.sh => health-disc-space/files/health-disc-space.sh} (100%) create mode 100644 roles/health-disc-space/handlers/main.yml rename roles/{disc-space-check => health-disc-space}/meta/main.yml (100%) create mode 100644 roles/health-disc-space/tasks/main.yml create mode 100644 roles/health-disc-space/templates/health-disc-space.service.j2 rename roles/{disc-space-check/templates/disc-space-check.timer.j2 => health-disc-space/templates/health-disc-space.timer.j2} (77%) create mode 100644 roles/health-disc-space/vars/main.yml rename roles/{docker-health-check/files/docker-health-check.sh => health-docker/files/health-docker.sh} (100%) create mode 100644 roles/health-docker/handlers/main.yml rename roles/{docker-health-check => health-docker}/meta/main.yml (100%) create mode 100644 roles/health-docker/tasks/main.yml rename roles/{docker-health-check/templates/docker-health-check.service.j2 => health-docker/templates/health-docker.service.j2} (58%) rename roles/{docker-health-check/templates/docker-health-check.timer.j2 => health-docker/templates/health-docker.timer.j2} (77%) create mode 100644 roles/health-docker/vars/main.yml rename roles/{journalctl-health-check => health-journalctl}/README.md (58%) rename roles/{journalctl-health-check/files/journalctl-health-check.sh => health-journalctl/files/health-journalctl.sh} (100%) create mode 100644 roles/health-journalctl/handlers/main.yml rename roles/{journalctl-health-check => health-journalctl}/meta/main.yml (100%) create mode 100644 roles/health-journalctl/tasks/main.yml rename roles/{journalctl-health-check/templates/journalctl-health-check.service.j2 => health-journalctl/templates/health-journalctl.service.j2} (57%) rename roles/{journalctl-health-check/templates/journalctl-health-check.timer.j2 => health-journalctl/templates/health-journalctl.timer.j2} (76%) create mode 100644 roles/health-journalctl/vars/main.yml delete mode 100644 roles/journalctl-health-check/handlers/main.yml delete mode 100644 roles/journalctl-health-check/tasks/main.yml delete mode 100644 roles/journalctl-health-check/vars/main.yml diff --git a/README.md b/README.md index d90b3b8e..e57ad888 100644 --- a/README.md +++ b/README.md @@ -31,8 +31,8 @@ This software allows to setup the docker following applications: This software shipts the following tools which are natively setup on the server: - [Backups Cleanup](./roles/backups-cleanup-timer/README.md) - Cleans up old backups -- [Btrfs Health Check](./roles/btrfs-health-check/README.md) - Checks the health of Btrfs file systems -- [Docker Health Check](./roles/docker-health-check/) - Checks the health of docker containers +- [Btrfs Health Check](./roles/health-btrfs/README.md) - Checks the health of Btrfs file systems +- [Docker Health Check](./roles/health-docker/) - Checks the health of docker containers - [Docker Reverse Proxy](./roles/docker-reverse-proxy/README.md) - Docker Reverse Proxy Solution - [Docker Volume Backup](./roles/docker-volume-backup/) - Backup Solution for Docker Volumes - [Pull Primary Backups](./roles/backups-consumer/README.md) - Pulls the backups from another server and stores them diff --git a/playbook.yml b/playbook.yml index d6808b48..faef7fda 100644 --- a/playbook.yml +++ b/playbook.yml @@ -11,9 +11,9 @@ roles: - system-security - journalctl - - disc-space-check + - health-disc-space - free-disc-space - - btrfs-health-check + - health-btrfs # Wireguard Rollen - name: setup standard wireguard diff --git a/roles/btrfs-health-check/handlers/main.yml b/roles/btrfs-health-check/handlers/main.yml deleted file mode 100644 index 3b37eed7..00000000 --- a/roles/btrfs-health-check/handlers/main.yml +++ /dev/null @@ -1,12 +0,0 @@ -- name: "reload btrfs-health-check.service" - systemd: - name: btrfs-health-check.service - state: reloaded - enabled: yes - daemon_reload: yes -- name: "restart btrfs-health-check.timer" - systemd: - name: btrfs-health-check.timer - state: restarted - enabled: yes - daemon_reload: yes diff --git a/roles/btrfs-health-check/tasks/main.yml b/roles/btrfs-health-check/tasks/main.yml deleted file mode 100644 index 4b1efa88..00000000 --- a/roles/btrfs-health-check/tasks/main.yml +++ /dev/null @@ -1,22 +0,0 @@ -- name: "create {{docker_btrfs_health_check_folder}}" - file: - path: "{{docker_btrfs_health_check_folder}}" - state: directory - mode: 0755 - -- name: create btrfs-health-check.sh - copy: - src: btrfs-health-check.sh - dest: "{{docker_btrfs_health_check_folder}}btrfs-health-check.sh" - -- name: create btrfs-health-check.service - template: - src: btrfs-health-check.service.j2 - dest: /etc/systemd/system/btrfs-health-check.service - notify: reload btrfs-health-check.service - -- name: create btrfs-health-check.timer - template: - src: btrfs-health-check.timer.j2 - dest: "/etc/systemd/system/btrfs-health-check.timer" - notify: restart btrfs-health-check.timer diff --git a/roles/disc-space-check/handlers/main.yml b/roles/disc-space-check/handlers/main.yml deleted file mode 100644 index ad1c55a9..00000000 --- a/roles/disc-space-check/handlers/main.yml +++ /dev/null @@ -1,12 +0,0 @@ -- name: "reload disc-space-check.service" - systemd: - name: disc-space-check.service - state: reloaded - enabled: yes - daemon_reload: yes -- name: "restart disc-space-check.timer" - systemd: - name: disc-space-check.timer - state: restarted - enabled: yes - daemon_reload: yes diff --git a/roles/disc-space-check/tasks/main.yml b/roles/disc-space-check/tasks/main.yml deleted file mode 100644 index c22e3b1c..00000000 --- a/roles/disc-space-check/tasks/main.yml +++ /dev/null @@ -1,22 +0,0 @@ -- name: "create {{disc_space_check_folder}}" - file: - path: "{{disc_space_check_folder}}" - state: directory - mode: 0755 - -- name: create disc-space-check.sh - copy: - src: disc-space-check.sh - dest: "{{disc_space_check_folder}}disc-space-check.sh" - -- name: create disc-space-check.service - template: - src: disc-space-check.service.j2 - dest: /etc/systemd/system/disc-space-check.service - notify: reload disc-space-check.service - -- name: create disc-space-check.timer - template: - src: disc-space-check.timer.j2 - dest: /etc/systemd/system/disc-space-check.timer - notify: restart disc-space-check.timer diff --git a/roles/disc-space-check/templates/disc-space-check.service.j2 b/roles/disc-space-check/templates/disc-space-check.service.j2 deleted file mode 100644 index e90943ad..00000000 --- a/roles/disc-space-check/templates/disc-space-check.service.j2 +++ /dev/null @@ -1,7 +0,0 @@ -[Unit] -Description=checking disc space -OnFailure=systemd-notifier@%n.service - -[Service] -Type=oneshot -ExecStart=/bin/bash {{disc_space_check_folder}}disc-space-check.sh {{size_percent_disc_space_warning}} diff --git a/roles/disc-space-check/vars/main.yml b/roles/disc-space-check/vars/main.yml deleted file mode 100644 index 1a5d05fe..00000000 --- a/roles/disc-space-check/vars/main.yml +++ /dev/null @@ -1 +0,0 @@ -disc_space_check_folder: "{{path_administrator_scripts}}disc-space-check/" \ No newline at end of file diff --git a/roles/docker-health-check/handlers/main.yml b/roles/docker-health-check/handlers/main.yml deleted file mode 100644 index cdaa75db..00000000 --- a/roles/docker-health-check/handlers/main.yml +++ /dev/null @@ -1,12 +0,0 @@ -- name: "reload docker-health-check.service" - systemd: - name: docker-health-check.service - state: reloaded - enabled: yes - daemon_reload: yes -- name: "restart docker-health-check.timer" - systemd: - name: docker-health-check.timer - state: restarted - enabled: yes - daemon_reload: yes diff --git a/roles/docker-health-check/tasks/main.yml b/roles/docker-health-check/tasks/main.yml deleted file mode 100644 index aeecbd72..00000000 --- a/roles/docker-health-check/tasks/main.yml +++ /dev/null @@ -1,20 +0,0 @@ -- name: "create {{docker_health_check_folder}}" - file: - path: "{{docker_health_check_folder}}" - state: directory - mode: 0755 - -- name: create docker-health-check.sh - copy: - src: docker-health-check.sh - dest: "{{docker_health_check_folder}}docker-health-check.sh" - -- name: create docker-health-check.service - template: src=docker-health-check.service.j2 dest=/etc/systemd/system/docker-health-check.service - notify: reload docker-health-check.service - -- name: create docker-health-check.timer - template: - src: docker-health-check.timer.j2 - dest: "/etc/systemd/system/docker-health-check.timer" - notify: restart docker-health-check.timer diff --git a/roles/docker-health-check/vars/main.yml b/roles/docker-health-check/vars/main.yml deleted file mode 100644 index c58af09e..00000000 --- a/roles/docker-health-check/vars/main.yml +++ /dev/null @@ -1 +0,0 @@ -docker_health_check_folder: "{{path_administrator_scripts}}docker-health-check/" \ No newline at end of file diff --git a/roles/docker/meta/main.yml b/roles/docker/meta/main.yml index fa459e27..1c90feff 100644 --- a/roles/docker/meta/main.yml +++ b/roles/docker/meta/main.yml @@ -1,5 +1,5 @@ dependencies: - docker-volume-backup - user-administrator - - docker-health-check + - health-docker - docker-compose-restart-unhealthy diff --git a/roles/btrfs-health-check/README.md b/roles/health-btrfs/README.md similarity index 93% rename from roles/btrfs-health-check/README.md rename to roles/health-btrfs/README.md index 1f888ba0..3ad04475 100644 --- a/roles/btrfs-health-check/README.md +++ b/roles/health-btrfs/README.md @@ -1,4 +1,4 @@ -# btrfs-health-check +# health-btrfs Sends a health report diff --git a/roles/btrfs-health-check/files/btrfs-health-check.sh b/roles/health-btrfs/files/health-btrfs.sh similarity index 100% rename from roles/btrfs-health-check/files/btrfs-health-check.sh rename to roles/health-btrfs/files/health-btrfs.sh diff --git a/roles/health-btrfs/handlers/main.yml b/roles/health-btrfs/handlers/main.yml new file mode 100644 index 00000000..45343678 --- /dev/null +++ b/roles/health-btrfs/handlers/main.yml @@ -0,0 +1,12 @@ +- name: "reload health-btrfs.service" + systemd: + name: health-btrfs.service + state: reloaded + enabled: yes + daemon_reload: yes +- name: "restart health-btrfs.timer" + systemd: + name: health-btrfs.timer + state: restarted + enabled: yes + daemon_reload: yes diff --git a/roles/btrfs-health-check/meta/main.yml b/roles/health-btrfs/meta/main.yml similarity index 100% rename from roles/btrfs-health-check/meta/main.yml rename to roles/health-btrfs/meta/main.yml diff --git a/roles/health-btrfs/tasks/main.yml b/roles/health-btrfs/tasks/main.yml new file mode 100644 index 00000000..9b7dfc90 --- /dev/null +++ b/roles/health-btrfs/tasks/main.yml @@ -0,0 +1,22 @@ +- name: "create {{docker_btrfs_health_check_folder}}" + file: + path: "{{docker_btrfs_health_check_folder}}" + state: directory + mode: 0755 + +- name: create health-btrfs.sh + copy: + src: health-btrfs.sh + dest: "{{docker_btrfs_health_check_folder}}health-btrfs.sh" + +- name: create health-btrfs.service + template: + src: health-btrfs.service.j2 + dest: /etc/systemd/system/health-btrfs.service + notify: reload health-btrfs.service + +- name: create health-btrfs.timer + template: + src: health-btrfs.timer.j2 + dest: "/etc/systemd/system/health-btrfs.timer" + notify: restart health-btrfs.timer diff --git a/roles/btrfs-health-check/templates/btrfs-health-check.service.j2 b/roles/health-btrfs/templates/health-btrfs.service.j2 similarity index 56% rename from roles/btrfs-health-check/templates/btrfs-health-check.service.j2 rename to roles/health-btrfs/templates/health-btrfs.service.j2 index f5771a81..6e26e74c 100644 --- a/roles/btrfs-health-check/templates/btrfs-health-check.service.j2 +++ b/roles/health-btrfs/templates/health-btrfs.service.j2 @@ -4,4 +4,4 @@ OnFailure=systemd-notifier@%n.service [Service] Type=oneshot -ExecStart=/bin/bash {{docker_btrfs_health_check_folder}}btrfs-health-check.sh +ExecStart=/bin/bash {{docker_btrfs_health_check_folder}}health-btrfs.sh diff --git a/roles/btrfs-health-check/templates/btrfs-health-check.timer.j2 b/roles/health-btrfs/templates/health-btrfs.timer.j2 similarity index 77% rename from roles/btrfs-health-check/templates/btrfs-health-check.timer.j2 rename to roles/health-btrfs/templates/health-btrfs.timer.j2 index be468c84..183ad383 100644 --- a/roles/btrfs-health-check/templates/btrfs-health-check.timer.j2 +++ b/roles/health-btrfs/templates/health-btrfs.timer.j2 @@ -1,5 +1,5 @@ [Unit] -Description=starts btrfs-health-check.service +Description=starts health-btrfs.service [Timer] OnCalendar={{on_calendar_btrfs_health_check}} diff --git a/roles/btrfs-health-check/vars/main.yml b/roles/health-btrfs/vars/main.yml similarity index 75% rename from roles/btrfs-health-check/vars/main.yml rename to roles/health-btrfs/vars/main.yml index ba2beb66..94cab36e 100644 --- a/roles/btrfs-health-check/vars/main.yml +++ b/roles/health-btrfs/vars/main.yml @@ -1 +1 @@ -docker_btrfs_health_check_folder: "{{path_administrator_scripts}}btrfs-health-check/" \ No newline at end of file +docker_btrfs_health_check_folder: "{{path_administrator_scripts}}health-btrfs/" \ No newline at end of file diff --git a/roles/disc-space-check/README.md b/roles/health-disc-space/README.md similarity index 63% rename from roles/disc-space-check/README.md rename to roles/health-disc-space/README.md index 3e6a5c17..98429e96 100644 --- a/roles/disc-space-check/README.md +++ b/roles/health-disc-space/README.md @@ -1,2 +1,2 @@ -# disc-space-check +# health-disc-space Checks if enough disc space is free \ No newline at end of file diff --git a/roles/disc-space-check/files/disc-space-check.sh b/roles/health-disc-space/files/health-disc-space.sh similarity index 100% rename from roles/disc-space-check/files/disc-space-check.sh rename to roles/health-disc-space/files/health-disc-space.sh diff --git a/roles/health-disc-space/handlers/main.yml b/roles/health-disc-space/handlers/main.yml new file mode 100644 index 00000000..33a5a482 --- /dev/null +++ b/roles/health-disc-space/handlers/main.yml @@ -0,0 +1,12 @@ +- name: "reload health-disc-space.service" + systemd: + name: health-disc-space.service + state: reloaded + enabled: yes + daemon_reload: yes +- name: "restart health-disc-space.timer" + systemd: + name: health-disc-space.timer + state: restarted + enabled: yes + daemon_reload: yes diff --git a/roles/disc-space-check/meta/main.yml b/roles/health-disc-space/meta/main.yml similarity index 100% rename from roles/disc-space-check/meta/main.yml rename to roles/health-disc-space/meta/main.yml diff --git a/roles/health-disc-space/tasks/main.yml b/roles/health-disc-space/tasks/main.yml new file mode 100644 index 00000000..ef05b4d1 --- /dev/null +++ b/roles/health-disc-space/tasks/main.yml @@ -0,0 +1,22 @@ +- name: "create {{disc_space_check_folder}}" + file: + path: "{{disc_space_check_folder}}" + state: directory + mode: 0755 + +- name: create health-disc-space.sh + copy: + src: health-disc-space.sh + dest: "{{disc_space_check_folder}}health-disc-space.sh" + +- name: create health-disc-space.service + template: + src: health-disc-space.service.j2 + dest: /etc/systemd/system/health-disc-space.service + notify: reload health-disc-space.service + +- name: create health-disc-space.timer + template: + src: health-disc-space.timer.j2 + dest: /etc/systemd/system/health-disc-space.timer + notify: restart health-disc-space.timer diff --git a/roles/health-disc-space/templates/health-disc-space.service.j2 b/roles/health-disc-space/templates/health-disc-space.service.j2 new file mode 100644 index 00000000..d7b6a7f3 --- /dev/null +++ b/roles/health-disc-space/templates/health-disc-space.service.j2 @@ -0,0 +1,7 @@ +[Unit] +Description=checking disc space +OnFailure=systemd-notifier@%n.service + +[Service] +Type=oneshot +ExecStart=/bin/bash {{disc_space_check_folder}}health-disc-space.sh {{size_percent_disc_space_warning}} diff --git a/roles/disc-space-check/templates/disc-space-check.timer.j2 b/roles/health-disc-space/templates/health-disc-space.timer.j2 similarity index 77% rename from roles/disc-space-check/templates/disc-space-check.timer.j2 rename to roles/health-disc-space/templates/health-disc-space.timer.j2 index cca1b2cb..26fa71ab 100644 --- a/roles/disc-space-check/templates/disc-space-check.timer.j2 +++ b/roles/health-disc-space/templates/health-disc-space.timer.j2 @@ -1,5 +1,5 @@ [Unit] -Description=starts disc-space-check.service +Description=starts health-disc-space.service [Timer] OnCalendar={{on_calendar_disc_space_check}} diff --git a/roles/health-disc-space/vars/main.yml b/roles/health-disc-space/vars/main.yml new file mode 100644 index 00000000..1dd7537c --- /dev/null +++ b/roles/health-disc-space/vars/main.yml @@ -0,0 +1 @@ +disc_space_check_folder: "{{path_administrator_scripts}}health-disc-space/" \ No newline at end of file diff --git a/roles/docker-health-check/files/docker-health-check.sh b/roles/health-docker/files/health-docker.sh similarity index 100% rename from roles/docker-health-check/files/docker-health-check.sh rename to roles/health-docker/files/health-docker.sh diff --git a/roles/health-docker/handlers/main.yml b/roles/health-docker/handlers/main.yml new file mode 100644 index 00000000..563e3c93 --- /dev/null +++ b/roles/health-docker/handlers/main.yml @@ -0,0 +1,12 @@ +- name: "reload health-docker.service" + systemd: + name: health-docker.service + state: reloaded + enabled: yes + daemon_reload: yes +- name: "restart health-docker.timer" + systemd: + name: health-docker.timer + state: restarted + enabled: yes + daemon_reload: yes diff --git a/roles/docker-health-check/meta/main.yml b/roles/health-docker/meta/main.yml similarity index 100% rename from roles/docker-health-check/meta/main.yml rename to roles/health-docker/meta/main.yml diff --git a/roles/health-docker/tasks/main.yml b/roles/health-docker/tasks/main.yml new file mode 100644 index 00000000..102ba4a4 --- /dev/null +++ b/roles/health-docker/tasks/main.yml @@ -0,0 +1,20 @@ +- name: "create {{docker_health_check_folder}}" + file: + path: "{{docker_health_check_folder}}" + state: directory + mode: 0755 + +- name: create health-docker.sh + copy: + src: health-docker.sh + dest: "{{docker_health_check_folder}}health-docker.sh" + +- name: create health-docker.service + template: src=health-docker.service.j2 dest=/etc/systemd/system/health-docker.service + notify: reload health-docker.service + +- name: create health-docker.timer + template: + src: health-docker.timer.j2 + dest: "/etc/systemd/system/health-docker.timer" + notify: restart health-docker.timer diff --git a/roles/docker-health-check/templates/docker-health-check.service.j2 b/roles/health-docker/templates/health-docker.service.j2 similarity index 58% rename from roles/docker-health-check/templates/docker-health-check.service.j2 rename to roles/health-docker/templates/health-docker.service.j2 index 456b36f2..92edad53 100644 --- a/roles/docker-health-check/templates/docker-health-check.service.j2 +++ b/roles/health-docker/templates/health-docker.service.j2 @@ -4,4 +4,4 @@ OnFailure=systemd-notifier@%n.service [Service] Type=oneshot -ExecStart=/bin/bash {{docker_health_check_folder}}docker-health-check.sh +ExecStart=/bin/bash {{docker_health_check_folder}}health-docker.sh diff --git a/roles/docker-health-check/templates/docker-health-check.timer.j2 b/roles/health-docker/templates/health-docker.timer.j2 similarity index 77% rename from roles/docker-health-check/templates/docker-health-check.timer.j2 rename to roles/health-docker/templates/health-docker.timer.j2 index 5f38e35e..1749255e 100644 --- a/roles/docker-health-check/templates/docker-health-check.timer.j2 +++ b/roles/health-docker/templates/health-docker.timer.j2 @@ -1,5 +1,5 @@ [Unit] -Description=starts docker-health-check.service +Description=starts health-docker.service [Timer] OnCalendar={{on_calendar_docker_health_check}} diff --git a/roles/health-docker/vars/main.yml b/roles/health-docker/vars/main.yml new file mode 100644 index 00000000..54de04d8 --- /dev/null +++ b/roles/health-docker/vars/main.yml @@ -0,0 +1 @@ +docker_health_check_folder: "{{path_administrator_scripts}}health-docker/" \ No newline at end of file diff --git a/roles/journalctl-health-check/README.md b/roles/health-journalctl/README.md similarity index 58% rename from roles/journalctl-health-check/README.md rename to roles/health-journalctl/README.md index 8a91c4ac..48767cc3 100644 --- a/roles/journalctl-health-check/README.md +++ b/roles/health-journalctl/README.md @@ -1,2 +1,2 @@ -# journalctl-health-check +# health-journalctl Checks journalctl for error messages \ No newline at end of file diff --git a/roles/journalctl-health-check/files/journalctl-health-check.sh b/roles/health-journalctl/files/health-journalctl.sh similarity index 100% rename from roles/journalctl-health-check/files/journalctl-health-check.sh rename to roles/health-journalctl/files/health-journalctl.sh diff --git a/roles/health-journalctl/handlers/main.yml b/roles/health-journalctl/handlers/main.yml new file mode 100644 index 00000000..3e67c284 --- /dev/null +++ b/roles/health-journalctl/handlers/main.yml @@ -0,0 +1,13 @@ +- name: "reload health-journalctl.service" + systemd: + name: health-journalctl.service + state: reloaded + enabled: yes + daemon_reload: yes + ignore_errors: true +- name: "restart health-journalctl.timer" + systemd: + name: health-journalctl.timer + state: restarted + enabled: yes + daemon_reload: yes diff --git a/roles/journalctl-health-check/meta/main.yml b/roles/health-journalctl/meta/main.yml similarity index 100% rename from roles/journalctl-health-check/meta/main.yml rename to roles/health-journalctl/meta/main.yml diff --git a/roles/health-journalctl/tasks/main.yml b/roles/health-journalctl/tasks/main.yml new file mode 100644 index 00000000..987739c9 --- /dev/null +++ b/roles/health-journalctl/tasks/main.yml @@ -0,0 +1,22 @@ +- name: "create {{journalctl_health_check_folder}}" + file: + path: "{{journalctl_health_check_folder}}" + state: directory + mode: 0755 + +- name: create health-journalctl.sh + copy: + src: health-journalctl.sh + dest: "{{journalctl_health_check_folder}}health-journalctl.sh" + +- name: create health-journalctl.service + template: + src: health-journalctl.service.j2 + dest: /etc/systemd/system/health-journalctl.service + notify: reload health-journalctl.service + +- name: create health-journalctl.timer + template: + src: health-journalctl.timer.j2 + dest: /etc/systemd/system/health-journalctl.timer + notify: restart health-journalctl.timer diff --git a/roles/journalctl-health-check/templates/journalctl-health-check.service.j2 b/roles/health-journalctl/templates/health-journalctl.service.j2 similarity index 57% rename from roles/journalctl-health-check/templates/journalctl-health-check.service.j2 rename to roles/health-journalctl/templates/health-journalctl.service.j2 index 7f687ea1..6e3a4bfa 100644 --- a/roles/journalctl-health-check/templates/journalctl-health-check.service.j2 +++ b/roles/health-journalctl/templates/health-journalctl.service.j2 @@ -4,4 +4,4 @@ OnFailure=systemd-notifier@%n.service [Service] Type=oneshot -ExecStart=/bin/bash {{journalctl_health_check_folder}}journalctl-health-check.sh +ExecStart=/bin/bash {{journalctl_health_check_folder}}health-journalctl.sh diff --git a/roles/journalctl-health-check/templates/journalctl-health-check.timer.j2 b/roles/health-journalctl/templates/health-journalctl.timer.j2 similarity index 76% rename from roles/journalctl-health-check/templates/journalctl-health-check.timer.j2 rename to roles/health-journalctl/templates/health-journalctl.timer.j2 index e262db3d..5cd7ce6e 100644 --- a/roles/journalctl-health-check/templates/journalctl-health-check.timer.j2 +++ b/roles/health-journalctl/templates/health-journalctl.timer.j2 @@ -1,5 +1,5 @@ [Unit] -Description=starts journalctl-health-check.service +Description=starts health-journalctl.service [Timer] OnCalendar={{on_calendar_journalctl_health_check}} diff --git a/roles/health-journalctl/vars/main.yml b/roles/health-journalctl/vars/main.yml new file mode 100644 index 00000000..2a700cac --- /dev/null +++ b/roles/health-journalctl/vars/main.yml @@ -0,0 +1 @@ +journalctl_health_check_folder: "{{path_administrator_scripts}}health-journalctl/" \ No newline at end of file diff --git a/roles/journalctl-health-check/handlers/main.yml b/roles/journalctl-health-check/handlers/main.yml deleted file mode 100644 index b5852f76..00000000 --- a/roles/journalctl-health-check/handlers/main.yml +++ /dev/null @@ -1,13 +0,0 @@ -- name: "reload journalctl-health-check.service" - systemd: - name: journalctl-health-check.service - state: reloaded - enabled: yes - daemon_reload: yes - ignore_errors: true -- name: "restart journalctl-health-check.timer" - systemd: - name: journalctl-health-check.timer - state: restarted - enabled: yes - daemon_reload: yes diff --git a/roles/journalctl-health-check/tasks/main.yml b/roles/journalctl-health-check/tasks/main.yml deleted file mode 100644 index ed68508c..00000000 --- a/roles/journalctl-health-check/tasks/main.yml +++ /dev/null @@ -1,22 +0,0 @@ -- name: "create {{journalctl_health_check_folder}}" - file: - path: "{{journalctl_health_check_folder}}" - state: directory - mode: 0755 - -- name: create journalctl-health-check.sh - copy: - src: journalctl-health-check.sh - dest: "{{journalctl_health_check_folder}}journalctl-health-check.sh" - -- name: create journalctl-health-check.service - template: - src: journalctl-health-check.service.j2 - dest: /etc/systemd/system/journalctl-health-check.service - notify: reload journalctl-health-check.service - -- name: create journalctl-health-check.timer - template: - src: journalctl-health-check.timer.j2 - dest: /etc/systemd/system/journalctl-health-check.timer - notify: restart journalctl-health-check.timer diff --git a/roles/journalctl-health-check/vars/main.yml b/roles/journalctl-health-check/vars/main.yml deleted file mode 100644 index 076169c8..00000000 --- a/roles/journalctl-health-check/vars/main.yml +++ /dev/null @@ -1 +0,0 @@ -journalctl_health_check_folder: "{{path_administrator_scripts}}journalctl-health-check/" \ No newline at end of file diff --git a/roles/journalctl/meta/main.yml b/roles/journalctl/meta/main.yml index 5156c9b5..7d52faa1 100644 --- a/roles/journalctl/meta/main.yml +++ b/roles/journalctl/meta/main.yml @@ -1,2 +1,2 @@ dependencies: - - journalctl-health-check + - health-journalctl