Add template for host-specific git configuration

This commit is contained in:
Fernando Schauenburg 2019-11-16 11:56:45 +00:00
parent 7e59326d1c
commit 55eb2a6a55
4 changed files with 23 additions and 1 deletions

View file

@ -1,6 +1,13 @@
--- ---
- name: Set up development machine - name: Set up development machine
hosts: localhost hosts: localhost
vars_prompt:
- name: git_user
private: no
default: Fernando Schauenburg
- name: git_email
private: no
default: fernando@schauenburg.me
roles: roles:
- packages - packages
- bin - bin

View file

@ -80,4 +80,5 @@
required = true required = true
[include] [include]
path = ~/.config/git/config.local path = ~/.config/git/config.host # host-specific (from template)
path = ~/.config/git/config.local # optional manual configurations

View file

@ -25,6 +25,11 @@
- config - config
- ignore - ignore
- name: Deploy git host-specific config
template:
src: config.host.j2
dest: ~/.config/git/config.host
- name: Create bin directory for additional git commands - name: Create bin directory for additional git commands
file: file:
path: ~/.local/bin path: ~/.local/bin

View file

@ -0,0 +1,9 @@
[user]
name = {{ git_user }}
email = {{ git_email }}
{% if ansible_os_family == 'Darwin' %}
[credential]
helper = osxkeychain
{% endif %}