puppetlabs/puppetlabs-git — pull request #18 by czerasz (2014-03-13 10:55:03+00:00)
Title: Add user support for git configuration

I tried to configure git for my vagrant user but it was impossible.
Instead the `.gitconfig` was saved for the root user:

# Before provisioning
root@webserver:/home/vagrant# ls -al ~
total 24
drwx------ 3 root root 4096 Mar 12 17:35 .
drwxr-xr-x 30 root root 4096 Mar 12 16:07 ..
-rw------- 1 root root 289 Mar 12 17:45 .bash_history
-rw-r--r-- 1 root root 3106 Jul 3 2012 .bashrc
drwxrwxr-x 3 root root 4096 Mar 12 16:07 .gem
-rw-r--r-- 1 root root 140 Jul 3 2012 .profile
# After provisioning
root@webserver:/home/vagrant# ls -al ~
total 28
drwx------ 3 root root 4096 Mar 12 17:45 .
drwxr-xr-x 30 root root 4096 Mar 12 16:07 ..
-rw------- 1 root root 289 Mar 12 17:45 .bash_history
-rw-r--r-- 1 root root 3106 Jul 3 2012 .bashrc
drwxrwxr-x 3 root root 4096 Mar 12 16:07 .gem
-rw-r--r-- 1 root root 94 Mar 12 17:45 .gitconfig
-rw-r--r-- 1 root root 140 Jul 3 2012 .profile

I used a similar configuration to [this one](https://github.com/czerasz/vagrant-presentation-vm/blob/master/provisioners/puppet/modules/profile/manifests/base.pp#L15-l23)

After the change I can set the config for a particular user:

git::config { 'user.name':
value => 'Mike Color',
require => Class['git'],
user => 'vagrant',
}

git::config { 'user.email':
value => 'email@example.com',
require => Class['git'],
user => 'vagrant',
}