commit_etc_git: more resilient to Git errors

* Errors should be ignored
* /etc might not be under verison control

If Git is installed but there is not repository for /etc,
the `git status` returns with a non-zero code.
This commit is contained in:
Jérémy Lecour 2017-02-07 17:47:49 +01:00 committed by Jérémy Lecour
parent 5bbc9caa4f
commit b095e4ffac
1 changed files with 3 additions and 1 deletions

View File

@ -8,6 +8,7 @@
# Use this with Ansible 2.1+
#when: not ansible_check_mod
always_run: yes
ignore_errors: yes
tags:
- git
@ -18,6 +19,7 @@
register: etc_commit_end_evolinux
# Use this with Ansible 2.1+
#when: not ansible_check_mode and git_status.stdout != ""
when: git_status.stdout != ""
when: git_status.rc == 0 and git_status.stdout != ""
ignore_errors: yes
tags:
- git