2016-12-21 15:39:50 +01:00
|
|
|
---
|
|
|
|
- name: is /etc clean?
|
|
|
|
command: git status --porcelain
|
|
|
|
args:
|
|
|
|
chdir: /etc
|
|
|
|
changed_when: False
|
|
|
|
register: git_status
|
2017-02-02 15:39:25 +01:00
|
|
|
# Use this with Ansible 2.1+
|
|
|
|
#when: not ansible_check_mod
|
|
|
|
always_run: yes
|
2016-12-21 15:39:50 +01:00
|
|
|
tags:
|
|
|
|
- git
|
|
|
|
|
|
|
|
- name: /etc modifications are committed
|
2017-01-11 18:18:42 +01:00
|
|
|
shell: "git add -A . && git commit -m \"{{ commit_message | default('Ansible run') }}\""
|
2016-12-21 15:39:50 +01:00
|
|
|
args:
|
|
|
|
chdir: /etc
|
|
|
|
register: etc_commit_end_evolinux
|
2017-02-02 15:39:25 +01:00
|
|
|
# Use this with Ansible 2.1+
|
|
|
|
#when: not ansible_check_mode and git_status.stdout != ""
|
|
|
|
when: git_status.stdout != ""
|
2016-12-21 15:39:50 +01:00
|
|
|
tags:
|
|
|
|
- git
|