From b02e49073a7659eaa124495dc4b1c8f0eb7b6a33 Mon Sep 17 00:00:00 2001 From: Gregory Colpart Date: Mon, 28 Aug 2017 19:44:11 +0200 Subject: [PATCH] don't crash when use in root (no SUDO_USER) --- etc-git/tasks/commit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc-git/tasks/commit.yml b/etc-git/tasks/commit.yml index 3d0562c9..e83d85c6 100644 --- a/etc-git/tasks/commit.yml +++ b/etc-git/tasks/commit.yml @@ -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 }}"