etc-git: conditional for cron job

This commit is contained in:
Jérémy Lecour 2018-09-08 00:27:03 +02:00
parent 37c4898eed
commit 92f14a496f
4 changed files with 9 additions and 2 deletions

View file

@ -11,6 +11,7 @@ The **patch** part changes incrementally at each release.
## [Unreleased]
### Added
* etc-git: manage a cron job to monitor uncommited changes in /etc/.git (default: `True`)
### Changed

View file

@ -29,3 +29,7 @@ There is also an independant task that can be executed to commit changes made in
vars:
commit_message: "Ansible post-run my splendid playbook"
```
## Available variables
* `etc_git_monitor_status`: monitor uncommited changes in /etc/.git (default: `True`) ;

View file

@ -1,2 +1,4 @@
---
commit_message: Ansible run
etc_git_monitor_status: True

View file

@ -95,7 +95,7 @@
special_time: "hourly"
user: root
job: "who > /dev/null || git --git-dir=/etc/.git --work-tree=/etc status --short"
state: present
state: "{{ etc_git_monitor_status | bool | ternary("present","absent") }}"
tags:
- etc-git
@ -106,6 +106,6 @@
hour: 21
minute: 21
job: "git --git-dir=/etc/.git --work-tree=/etc status --short"
state: present
state: "{{ etc_git_monitor_status | bool | ternary("present","absent") }}"
tags:
- etc-git