From 46a9b4f43ef7becdc76a6cae484108467986f0b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lecour?= Date: Sat, 8 Sep 2018 01:05:58 +0200 Subject: [PATCH] etc-git: remove cron file if needed --- etc-git/tasks/main.yml | 12 ++++++++++-- etc-git/{files => templates}/etc-git-status.j2 | 0 2 files changed, 10 insertions(+), 2 deletions(-) rename etc-git/{files => templates}/etc-git-status.j2 (100%) diff --git a/etc-git/tasks/main.yml b/etc-git/tasks/main.yml index cfd0cca4..029d102c 100644 --- a/etc-git/tasks/main.yml +++ b/etc-git/tasks/main.yml @@ -89,11 +89,19 @@ tags: - etc-git -- name: Cron job for /etc/.git status +- name: Cron job for /etc/.git status is installed template: src: etc-git-status.j2 dest: /etc/cron.d/etc-git-status mode: "0644" - state: "{{ etc_git_monitor_status | bool | ternary('present','absent') }}" + when: etc_git_monitor_status + tags: + - etc-git + +- name: Cron job for /etc/.git status is removed + file: + dest: /etc/cron.d/etc-git-status + state: absent + when: not etc_git_monitor_status tags: - etc-git diff --git a/etc-git/files/etc-git-status.j2 b/etc-git/templates/etc-git-status.j2 similarity index 100% rename from etc-git/files/etc-git-status.j2 rename to etc-git/templates/etc-git-status.j2