diff --git a/roles/git/tasks/main.yml b/roles/git/tasks/main.yml index a58c3c9..b349ddf 100644 --- a/roles/git/tasks/main.yml +++ b/roles/git/tasks/main.yml @@ -32,15 +32,12 @@ name: user.email register: git_useremail - - -# TODO: check this - name: Set vars for global gitconfig + vars: + username_if_absent: "{{ ansible_facts['env']['USER'] }}@{{ ansible_hostname }}" set_fact: - username: "{{ (git_username.config_value != "") | ternary(git_username.config_value, ansible_facts['env']['USER']\@ansible_hostname) }}" - useremail: "{{ (git_useremail.config_value != "") | ternary(git_useremail.config_value, git_email) }}" - - + username: "{{ (git_username.config_value != '') | ternary(git_username.config_value, username_if_absent) }}" + useremail: "{{ (git_useremail.config_value != '') | ternary(git_useremail.config_value, git_email) }}" - name: Copy global gitconfig template: