Skip to content
This repository has been archived by the owner on Oct 26, 2022. It is now read-only.

Commit

Permalink
rewrite gitconfig copied from host
Browse files Browse the repository at this point in the history
  • Loading branch information
byrond committed Nov 6, 2018
1 parent 50f2d30 commit 6bc225e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
20 changes: 20 additions & 0 deletions conf/vagrant/provisioning/roles/common/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,25 @@
- name: Common | Configure PALANTIR_ENVIRONMENT variable
lineinfile: dest=/home/vagrant/.profile state=present line='export PALANTIR_ENVIRONMENT="vagrant"'
tags: common

- name: Common | Get user.name from host's gitconfig
git_config:
name: user.name
scope: global
register: git_author_name
tags: common

- name: Common | Get user.email from host's gitconfig
git_config:
name: user.email
scope: global
register: git_author_email
tags: common

- name: Common | Copy gitconfig from template
template:
src: gitconfig
dest: /home/vagrant/.gitconfig

- name: Common | Copy gitignore
copy: src=roles/common/templates/gitignore dest=/home/vagrant/.gitignore
Expand All @@ -21,6 +40,7 @@
- name: Common | Configure global gitignore
command: /usr/bin/git config --global core.excludesfile ~/.gitignore
tags: common


- name: Check for user-specific provisioning script
stat: path=/var/www/{{ hostname }}/conf/provision-user
Expand Down
4 changes: 4 additions & 0 deletions conf/vagrant/provisioning/roles/common/templates/gitconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# This is Git's per-user configuration file.
[user]
name = {{ git_author_name }}
email = {{ git_author_email }}

0 comments on commit 6bc225e

Please sign in to comment.