From b5b46e707c309afcbd33e999543fe3969d9f9f14 Mon Sep 17 00:00:00 2001 From: Gregory Colpart Date: Fri, 29 Sep 2017 01:42:38 +0200 Subject: [PATCH] Quick fix to avoid failure when you are in root without su/sudo --- 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 c11b453c..9beff149 100644 --- a/etc-git/tasks/commit.yml +++ b/etc-git/tasks/commit.yml @@ -26,7 +26,7 @@ - name: "set commit author" set_fact: - commit_author: '{% if ansible_env.SUDO_USER == "" %}root{% else %}{{ ansible_env.SUDO_USER }}{% endif %}' + commit_author: '{% if ansible_env.SUDO_USER is not defined %}root{% else %}{{ ansible_env.SUDO_USER }}{% endif %}' commit_email: '{% if git_config_user_email.config_value == "" %}root@localhost{% else %}{{ git_config_user_email.config_value }}{% endif %}' - name: "/etc modifications are committed"