don't crash when use in root (no SUDO_USER)

This commit is contained in:
Gregory Colpart 2017-08-28 19:44:11 +02:00
parent 1b80956043
commit b02e49073a
1 changed files with 1 additions and 1 deletions

View File

@ -26,7 +26,7 @@
- name: set commit author
set_fact:
etc_git_commit_options: "{% if ansible_env.SUDO_USER %} --author \"{{ ansible_env.SUDO_USER }} <{{ git_config_user_email.config_value |default()}}>\"{% endif %}"
etc_git_commit_options: "{ --author \"{{ ansible_env.SUDO_USER |default(\"root\")}} <{{ git_config_user_email.config_value |default(\"root@localhost\")}}>\""
- name: /etc modifications are committed
shell: "git add -A . && git commit -m \"{{ commit_message | mandatory }}\"{{ etc_git_commit_options }}"