Only do etckeeper commit when there are uncomitted changes

pull/13/head
Zachary Seguin 6 years ago
parent 1dbbb3c70c
commit 7db86ddd7c
  1. 8
      roles/cleanup/tasks/main.yml

@ -1,6 +1,12 @@
---
- name: check for uncommitted changes
command: 'etckeeper unclean'
register: etckeeper_unclean
failed_when: false
- name: etckeeper commit
command: "{{ item }}"
with_items:
- 'etckeeper commit "Ansible (re-)build playbook run"'
- 'etckeeper commit "Ansible (re-)build playbook run"'
when: etckeeper_unclean.rc == 0

Loading…
Cancel
Save