An Ansible role that configures git for various users.
None
Available variables are listed below, along with default values:
gitconfig_users: []
Possible values for each entry in gitconfig_users
are, along with default values:
user: ~
name: ~
email: ~
ignore_github: []
ignore_custom: ~
push_default: simple
fetch_prune: yes
The key user
defines the username which this configuration should be applied to.
The configuration will be stored in /home/{user}
.
With the keys name
and email
the corresponding git config parameters can be set.
A global gitignore list can be configured using GitHub files and a custom list.
The key ignore_github
can contain a list of file names which can be found on https://github.com/github/gitignore/tree/master/Global.
With the key ignore_custom
you can define a custom gitignore list.
The default behaviour for pushing can be defined in the key push_default
which defaults to simple
.
See https://git-scm.com/docs/git-config.html#git-config-pushdefault for more information.
By default git will be configured to add --prune
when fetching from a remote.
This can be disabled with setting fetch_prune
to no
.
See https://git-scm.com/docs/git-config.html#git-config-fetchprune for more information.
None
- hosts: all
roles:
- { role: mjanser.gitconfig }
vars:
gitconfig_users:
- user: vagrant
name: Vagrant User
email: info@example.com
ignore_github:
- Linux
- Vim
ignore_custom: |
.vagrant
*.bak
MIT