From 1e807478f00e2eee4d4afe9aeec730448a33c3bc Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Mon, 30 Dec 2024 18:49:38 +0100 Subject: [PATCH] dd --- .../mgrote_docker_housekeeping/tasks/main.yml | 21 ++++++------------- roles/mgrote_rsync/tasks/source.yml | 2 +- roles/mgrote_todoist_backup/tasks/main.yml | 2 +- roles/mgrote_youtubedl/tasks/main.yml | 2 +- 4 files changed, 9 insertions(+), 18 deletions(-) diff --git a/roles/mgrote_docker_housekeeping/tasks/main.yml b/roles/mgrote_docker_housekeeping/tasks/main.yml index b56c2559..337a4c40 100644 --- a/roles/mgrote_docker_housekeeping/tasks/main.yml +++ b/roles/mgrote_docker_housekeeping/tasks/main.yml @@ -1,26 +1,17 @@ --- -- name: Setup docker housekeeping tasks +- name: Ensure systemd services are templated become: true ansible.builtin.template: - src: docker_housekeeping.service.j2 - dest: /etc/systemd/system/docker_housekeeping.service + src: "{{ item }}.j2" + dest: /etc/systemd/system/{{ item }} owner: root group: root mode: "0644" notify: - systemctl daemon-reload - -- name: Setup timer - become: true - ansible.builtin.template: - src: docker_housekeeping.timer.j2 - dest: /etc/systemd/system/docker_housekeeping.timer - owner: root - group: root - mode: "0644" - notify: - - systemctl daemon-reload - - Start timer + loop: + - docker_housekeeping.service + - docker_housekeeping.timer - name: Enable Units become: true diff --git a/roles/mgrote_rsync/tasks/source.yml b/roles/mgrote_rsync/tasks/source.yml index 2ca0a31c..ee201d68 100644 --- a/roles/mgrote_rsync/tasks/source.yml +++ b/roles/mgrote_rsync/tasks/source.yml @@ -34,7 +34,7 @@ - rsync_mirror - rsync_mirror_log -- name: Ensure services are present +- name: Ensure systemd services are templated become: true ansible.builtin.template: src: "{{ item }}.j2" diff --git a/roles/mgrote_todoist_backup/tasks/main.yml b/roles/mgrote_todoist_backup/tasks/main.yml index 8fcbf4c1..e51bf6cc 100644 --- a/roles/mgrote_todoist_backup/tasks/main.yml +++ b/roles/mgrote_todoist_backup/tasks/main.yml @@ -14,7 +14,7 @@ group: root mode: "0754" -- name: Ensure services are present +- name: Ensure systemd services are templated become: true ansible.builtin.template: src: "{{ item }}.j2" diff --git a/roles/mgrote_youtubedl/tasks/main.yml b/roles/mgrote_youtubedl/tasks/main.yml index ae222b9d..7640a48a 100644 --- a/roles/mgrote_youtubedl/tasks/main.yml +++ b/roles/mgrote_youtubedl/tasks/main.yml @@ -48,7 +48,7 @@ - systemctl daemon-reload when: ytdl_enable_podcast_download -- name: Ensure services are present +- name: Ensure systemd services are templated become: true ansible.builtin.template: src: "{{ item }}.j2"