1
0
Fork 0

small etckeeper adjustements

This commit is contained in:
Chl 2020-01-17 23:45:11 +01:00
parent e54b5a5663
commit 9b9a503fbf
2 changed files with 5 additions and 6 deletions

View file

@ -14,3 +14,6 @@ all:
# variable globally or by host.
# By default : False
jenkins_installonly: False
# Check if etckeeper is installed and /etc is clean
checketckeeper: True

View file

@ -8,17 +8,13 @@
ignore_errors: True
register: tmp
changed_when: False
when: checketckeeper is undefined or checketckeeper
- name: Set fact about etckeeper presence
set_fact:
etckeeper_installed: "{{ tmp.rc == 0 }}"
etckeeper_installed: "{{ tmp.rc is defined and tmp.rc == 0 }}"
- name: Check that /etc is clean
shell: etckeeper unclean && echo "Uncommitted changes." && return 1 || return 0
ignore_errors: True # we add a 'fail' task to tell the problem more explictly.
register: tmp
changed_when: False
when: etckeeper_installed
- fail:
msg: "Etckeeper is installed but there is uncommitted changes in /etc."
when: etckeeper_installed and tmp.rc != 0