Make git commit task not to fail if user.email is undefined
This commit is contained in:
parent
29e1c3053f
commit
48b4238a88
|
@ -22,10 +22,11 @@
|
||||||
repo: /etc
|
repo: /etc
|
||||||
scope: local
|
scope: local
|
||||||
register: git_config_user_email
|
register: git_config_user_email
|
||||||
|
ignore_errors: yes
|
||||||
|
|
||||||
- name: set commit author
|
- name: set commit author
|
||||||
set_fact:
|
set_fact:
|
||||||
etc_git_commit_options: "{% if ansible_env.SUDO_USER %} --author \"{{ ansible_env.SUDO_USER }} <{{ git_config_user_email.config_value }}>\"{% endif %}"
|
etc_git_commit_options: "{% if ansible_env.SUDO_USER %} --author \"{{ ansible_env.SUDO_USER }} <{{ git_config_user_email.config_value |default()}}>\"{% endif %}"
|
||||||
|
|
||||||
- name: /etc modifications are committed
|
- name: /etc modifications are committed
|
||||||
shell: "git add -A . && git commit -m \"{{ commit_message | mandatory }}\"{{ etc_git_commit_options }}"
|
shell: "git add -A . && git commit -m \"{{ commit_message | mandatory }}\"{{ etc_git_commit_options }}"
|
||||||
|
|
Loading…
Reference in a new issue