============
A puppet module for managing the installation and configuration of git so that it is available by use by the Puppetlabs vcsrepo
module. This includes installing, configuring and the installation of git, the configuration of git specific settings, executing git commands, and eventually the management of git hook scripts.
WARNING The use of this module to manage git repositories is being depreciated and will soon become obsolete. It is recommended that the Puppetlabs vcsrepo module is used manage repositories.
git
This class installs and manages the git package.
A basic install with the defaults would be:
include git
Otherwise using the parametrs:
class{git:
svn => 'installed',
gui => 'installed',
}
installed
.installed
.absent
.git
, except for older versions of Debian and Ubuntu where the default is git-core
.git::user
This basically sets the users name and email by configuring the git global variables as that user, and should allow them to use git without warnings about these values being unset. The user name should be a valid user account that has been previously defined in Puppet.
With default settings just use:
git::user{'username':}
Otherwise using parameters:
git::user{'username':
user_name => 'Some User',
user_email => 'someuser@example.org',
}
${name} on ${fqdn}
, where fqdn is the fully qualified domain name as discovered by facter.${name}@${fqdn}
, where fqdn is the fully qualified domain name as discovered by facter.git::config
This resource allows puppet to manage git configurations at the system (setting defaults for all usage), global (setting defaults for all a user's repositories), and local (setting defaults for a repository). These contexts are represented by the provider
parameter.
When setting a global config value a user is required:
git::config{'git_core_autocrlf':
config => 'core.autocrlf',
value => 'input',
provider => 'global',
user => $user
}
When setting a local config value a vcsrepo
repository is required:
git::config{'git_core_autocrlf':
config => 'core.autocrlf',
value => 'input',
provider => 'local',
repo => 'reponame'
}
git::repo
Using the git::repo
class is depreciated and vcsrepo
should be considered instead.
This will clone a git repository from a vaild git URI to a specified path on the target server. It is strongly recommended that read-only git URIs are used. If no source is given, the target path will simply be initialised as a git repository.
With minimum parameters, should create the directory /usr/src/repo
and run git init
in it:
git::repo{'repo_name':
path => '/usr/src/repo',
}
With minimum parameters to clone from a remote source:
git::repo{'repo_name':
path => '/usr/src/repo',
source => 'git://example.org/example/repo.git'
}
Note: I am uncertain on how it will behave if both tag and branch are set, but tag should override branch.
This module is derived from the puppet-blank module by Aaron Hicks (aethylred@gmail.com)
This module has been developed for the use with Open Source Puppet (Apache 2.0 license) for automating server & service deployment.
This file is part of the git Puppet module.
The git Puppet module is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
The git Puppet module is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with the git Puppet module. If not, see http://www.gnu.org/licenses/.