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