From 82c70984976843b10f5565afc261a093a990beb3 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Sun, 26 Mar 2023 23:29:30 +0200 Subject: [PATCH] solved bugs --- .../docker-compose-restart-unhealthy.py} | 0 .../handlers/main.yml | 4 ++-- .../tasks/main.yml | 11 +++++++---- .../docker-compose-restart-unhealthy.service.j2 | 2 +- roles/native-docker-volume-backup/tasks/main.yml | 6 +++--- .../templates/docker-volume-backup.service.j2 | 2 +- roles/native-systemd-email/tasks/main.yml | 2 +- 7 files changed, 15 insertions(+), 12 deletions(-) rename roles/native-docker-compose-restart-unhealthy/{templates/docker-compose-restart-unhealthy.py.j2 => files/docker-compose-restart-unhealthy.py} (100%) diff --git a/roles/native-docker-compose-restart-unhealthy/templates/docker-compose-restart-unhealthy.py.j2 b/roles/native-docker-compose-restart-unhealthy/files/docker-compose-restart-unhealthy.py similarity index 100% rename from roles/native-docker-compose-restart-unhealthy/templates/docker-compose-restart-unhealthy.py.j2 rename to roles/native-docker-compose-restart-unhealthy/files/docker-compose-restart-unhealthy.py diff --git a/roles/native-docker-compose-restart-unhealthy/handlers/main.yml b/roles/native-docker-compose-restart-unhealthy/handlers/main.yml index 37c62838..a296836f 100644 --- a/roles/native-docker-compose-restart-unhealthy/handlers/main.yml +++ b/roles/native-docker-compose-restart-unhealthy/handlers/main.yml @@ -1,7 +1,7 @@ -- name: "restart docker-compose-restart-unhealthy.service" +- name: "reloaded docker-compose-restart-unhealthy.service" systemd: name: docker-compose-restart-unhealthy.service - state: restarted + state: reloaded enabled: yes daemon_reload: yes - name: "restart docker-compose-restart-unhealthy.timer" diff --git a/roles/native-docker-compose-restart-unhealthy/tasks/main.yml b/roles/native-docker-compose-restart-unhealthy/tasks/main.yml index ad1b66ae..181f30f8 100644 --- a/roles/native-docker-compose-restart-unhealthy/tasks/main.yml +++ b/roles/native-docker-compose-restart-unhealthy/tasks/main.yml @@ -5,12 +5,15 @@ mode: 0755 - name: create docker-compose-restart-unhealthy.py - template: src=docker-compose-restart-unhealthy.py.j2 dest={{docker_docker_compose_restart_unhealthy}}docker-compose-restart-unhealthy.py - notify: restart docker-compose-restart-unhealthy.service + copy: + src: docker-compose-restart-unhealthy.py + dest: "{{docker_docker_compose_restart_unhealthy}}docker-compose-restart-unhealthy.py" - name: create docker-compose-restart-unhealthy.service - template: src=docker-health-check.service.j2 dest=/etc/systemd/system/docker-compose-restart-unhealthy.service - notify: restart docker-compose-restart-unhealthy.service + template: + src: docker-compose-restart-unhealthy.service.j2 + dest: /etc/systemd/system/docker-compose-restart-unhealthy.service + notify: reloaded docker-compose-restart-unhealthy.service - name: create docker-compose-restart-unhealthy.timer copy: diff --git a/roles/native-docker-compose-restart-unhealthy/templates/docker-compose-restart-unhealthy.service.j2 b/roles/native-docker-compose-restart-unhealthy/templates/docker-compose-restart-unhealthy.service.j2 index 4d15bcd4..f56c2faf 100644 --- a/roles/native-docker-compose-restart-unhealthy/templates/docker-compose-restart-unhealthy.service.j2 +++ b/roles/native-docker-compose-restart-unhealthy/templates/docker-compose-restart-unhealthy.service.j2 @@ -4,4 +4,4 @@ OnFailure=systemd-email@%n.service [Service] Type=oneshot -ExecStart=/bin/bash {{docker_docker_compose_restart_unhealthy}}docker-compose-restart-unhealthy.py +ExecStart=/bin/python {{docker_docker_compose_restart_unhealthy}}docker-compose-restart-unhealthy.py diff --git a/roles/native-docker-volume-backup/tasks/main.yml b/roles/native-docker-volume-backup/tasks/main.yml index dbf099bd..25f887d1 100644 --- a/roles/native-docker-volume-backup/tasks/main.yml +++ b/roles/native-docker-volume-backup/tasks/main.yml @@ -16,9 +16,9 @@ template: src=docker-volume-backup.timer.j2 dest=/etc/systemd/system/docker-volume-backup.timer notify: restart docker-volume-backup timer -- name: create {{docker_volume_backup_folder}}/databases.csv +- name: create {{docker_volume_backup_folder}}databases.csv copy: - src: "{{ inventory_dir }}/files/{{ inventory_hostname }}{{docker_volume_backup_folder}}/databases.csv" - dest: "{{docker_volume_backup_folder}}/databases.csv" + src: "{{ inventory_dir }}/files/{{ inventory_hostname }}{{docker_volume_backup_folder}}databases.csv" + dest: "{{docker_volume_backup_folder}}databases.csv" owner: root group: root diff --git a/roles/native-docker-volume-backup/templates/docker-volume-backup.service.j2 b/roles/native-docker-volume-backup/templates/docker-volume-backup.service.j2 index 8febb335..a2f8ba9c 100644 --- a/roles/native-docker-volume-backup/templates/docker-volume-backup.service.j2 +++ b/roles/native-docker-volume-backup/templates/docker-volume-backup.service.j2 @@ -4,4 +4,4 @@ OnFailure=systemd-email@%n.service [Service] Type=oneshot -ExecStart=/usr/bin/python {{docker_volume_backup_folder}}/docker-volume-backup.py \ No newline at end of file +ExecStart=/usr/bin/python {{docker_volume_backup_folder}}docker-volume-backup.py \ No newline at end of file diff --git a/roles/native-systemd-email/tasks/main.yml b/roles/native-systemd-email/tasks/main.yml index 56d0045b..1683d157 100644 --- a/roles/native-systemd-email/tasks/main.yml +++ b/roles/native-systemd-email/tasks/main.yml @@ -11,7 +11,7 @@ mode: 0755 - name: configure systemd-email.sh - template: src=systemd-email.sh.j2 dest={{systemd_email_folder}}bin/systemd-email.sh + template: src=systemd-email.sh.j2 dest={{systemd_email_folder}}systemd-email.sh - name: configure systemd-email.service template: src=systemd-email@.service.j2 dest=/etc/systemd/system/systemd-email@.service