Add template for host-specific git configuration
This commit is contained in:
parent
7e59326d1c
commit
55eb2a6a55
4 changed files with 23 additions and 1 deletions
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
9
roles/git/templates/config.host.j2
Normal file
9
roles/git/templates/config.host.j2
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
[user]
|
||||||
|
name = {{ git_user }}
|
||||||
|
email = {{ git_email }}
|
||||||
|
|
||||||
|
{% if ansible_os_family == 'Darwin' %}
|
||||||
|
[credential]
|
||||||
|
helper = osxkeychain
|
||||||
|
{% endif %}
|
||||||
|
|
Loading…
Add table
Reference in a new issue