Skip to content

Aethylred/puppet-git

 
 

Repository files navigation

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 => '[email protected]',
}

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 ([email protected])

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 61.6%
  • Puppet 35.4%
  • Pascal 3.0%