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

Commit

Permalink
Merge pull request #58 from palantirnet/zrad-127-configure-git-user
Browse files Browse the repository at this point in the history
ZRAD-127: provision gitconfig into the vm
  • Loading branch information
becw authored Nov 28, 2018
2 parents 06dcb0c + 447726c commit 47a3398
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
23 changes: 23 additions & 0 deletions conf/vagrant/provisioning/roles/common/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,29 @@
lineinfile: dest=/home/vagrant/.profile state=present line='export PALANTIR_ENVIRONMENT="vagrant"'
tags: common

- name: Common | Copy user's gitconfig from host
copy: src=~/.gitconfig dest=/home/vagrant/.gitconfig
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
tags: common
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.config_value }}
email = {{ git_author_email.config_value }}

0 comments on commit 47a3398

Please sign in to comment.