Forge Home

git

A module for installing and managing Git

13,733 downloads

10,030 latest version

4.6 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 0.3.1 (latest)
  • 0.2.0
  • 0.1.2
  • 0.1.1
  • 0.1.0 (deleted)
  • 0.0.1 (deleted)
released Nov 23rd 2014
This version is compatible with:
  • , , , , ArchLinux

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'Aethylred-git', '0.3.1'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add Aethylred-git
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install Aethylred-git --version 0.3.1

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download
Tags: git

Documentation

Aethylred/git — version 0.3.1 Nov 23rd 2014

puppet-git

============

Build Status

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.

Implemented Features:

  • Installs git from packages
  • Optionally installs git-svn from packages (defaults installed)
  • Optionally installs git-gui from packages (defaults not installed)

Features not yet updated

  • Initialising user accounts with git configurations
  • Configure global and local git configurations
  • Executing git commands not provided by the Puppetlabs vcsrepo module.
  • Injecting hook scripts into git repositories.

Classes

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',
}

Parameters

  • ensure: Sets the ensure parameter passed to the git package. The default is installed.
  • svn: Sets the ensure paramater passed to the git-svn package. The default is installed.
  • gui: Sets the ensure parameter passed to the git-gui package. The default is absent.
  • package: Specifies a custom package. The default is git, except for older versions of Debian and Ubuntu where the default is git-core.
  • git_root: Currently does nothing, it's functionality is to be reviewed.

Resources

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',
}

Parameters

  • user_name sets the user's name to the specified string, and not the default of ${name} on ${fqdn}, where fqdn is the fully qualified domain name as discovered by facter.
  • user_email sets the user's email address to the specified string, and not the default of ${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'
}

Parameters

  • path sets the path where the git repository is created or cloned to
  • source sets the git URI from which the git repository is cloned from
  • branch this string sets a specific branch to check out
  • git_tag this string sets a specific tag to check out
  • update if set to true, when puppet runs it will revert any local changes and pull the current branch from the source if there is any difference between the local repository and the source repository.
  • bare if set to true, it creates a bare repository

Note: I am uncertain on how it will behave if both tag and branch are set, but tag should override branch.

Dependencies

Attribution

puppet-blank

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.

Gnu General Public License

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/.