EvoBSD/tasks/commit_etc_git.yml

28 lines
730 B
YAML
Raw Normal View History

2018-12-28 11:23:49 +01:00
---
- name: is /etc clean?
command: git status --porcelain
args:
chdir: /etc
changed_when: false
2018-12-28 11:23:49 +01:00
register: git_status
when: not ansible_check_mode
ignore_errors: true
2018-12-28 11:23:49 +01:00
tags:
- commit-etc
# yamllint disable rule:line-length
2018-12-28 11:23:49 +01:00
- name: /etc modifications are committed
shell: >
git add -A .
&& git commit
-m "{{ commit_message | default('Ansible run') }}"
--author="{{ ansible_env.SUDO_USER | default('Root') }}
<{{ ansible_env.SUDO_USER | default('Root') }}@{{ general_technical_realm }}>"
2018-12-28 11:23:49 +01:00
args:
chdir: /etc
register: etc_commit_end_evolinux
when: not ansible_check_mode and git_status.stdout != ""
ignore_errors: true
2018-12-28 11:23:49 +01:00
tags:
- commit-etc
# yamllint enable rule:line-length