Try ternary on git role
This commit is contained in:
parent
2364480b49
commit
306787a60a
1 changed files with 5 additions and 15 deletions
|
@ -32,25 +32,15 @@
|
||||||
name: user.email
|
name: user.email
|
||||||
register: git_useremail
|
register: git_useremail
|
||||||
|
|
||||||
- name: Reuse username
|
|
||||||
set_fact:
|
|
||||||
username: "{{ git_username.config_value }}"
|
|
||||||
when: git_username.config_value != ""
|
|
||||||
|
|
||||||
- name: Set new username
|
|
||||||
set_fact:
|
|
||||||
username: "{{ ansible_facts['env']['USER'] }}@{{ ansible_hostname }}"
|
|
||||||
when: git_username.config_value == ""
|
|
||||||
|
|
||||||
- name: Reuse useremail
|
# TODO: check this
|
||||||
|
- name: Set vars for global gitconfig
|
||||||
set_fact:
|
set_fact:
|
||||||
useremail: "{{ git_useremail.config_value }}"
|
username: "{{ (git_username.config_value != "") | ternary(git_username.config_value, ansible_facts['env']['USER']\@ansible_hostname) }}"
|
||||||
when: git_useremail.config_value != ""
|
useremail: "{{ (git_useremail.config_value != "") | ternary(git_useremail.config_value, git_email) }}"
|
||||||
|
|
||||||
|
|
||||||
- name: Set new useremail
|
|
||||||
set_fact:
|
|
||||||
useremail: "{{ git_email }}" # Set in vault
|
|
||||||
when: git_useremail.config_value == ""
|
|
||||||
|
|
||||||
- name: Copy global gitconfig
|
- name: Copy global gitconfig
|
||||||
template:
|
template:
|
||||||
|
|
Loading…
Add table
Reference in a new issue