Forge Home

git

Install, manage and configure latest version of git

43,047 downloads

1,313 latest version

5.0 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

  • 2.0.3 (latest)
  • 2.0.2
  • 2.0.1
  • 1.6.0
  • 1.5.2
  • 1.5.1
  • 1.5.0
  • 1.4.1
  • 1.4.0
  • 1.3.0
  • 1.2.2
  • 1.2.1
  • 1.2.0
  • 1.1.4
  • 1.1.3
  • 1.1.2
  • 1.1.1
  • 1.1.0
  • 1.0.0
  • 0.6.0
  • 0.5.0
  • 0.4.0
  • 0.3.0
  • 0.2.0
  • 0.1.3
  • 0.1.2
  • 0.1.1
  • 0.1.0 (deleted)
released Dec 8th 2022
This version is compatible with:
  • Puppet Enterprise 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x, 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x
  • Puppet >= 6.0.0 < 8.0.0
  • , , OracleLinux, Scientific, Fedora, Rocky, AlmaLinux, SLES, , , FreeBSD, DragonFly, ArchLinux

Start using this module

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

Add this module to your Puppetfile:

mod 'rehan-git', '2.0.3'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

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

Manually install this module globally with Puppet module tool:

puppet module install rehan-git --version 2.0.3

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

Documentation

rehan/git — version 2.0.3 Dec 8th 2022

rehan-git

Puppet Forge Build Status

Table of Contents

  1. Overview
  2. Module Description
  3. Setup
  4. Usage
  5. Dependencies
  6. Development

Overview

The rehan-git module manages the Git, the distributed revision control system.

Module Description

A puppet module for managing the installation and configuration of git so that it is available to be used by puppetlabs-vcsrepo module. This module installs and configures the git package and allows configuration of user specific git settings.

Where possible, this module can be used to ensure the git installation is up to date with latest upstream release of git. Currently, this feature is supported for the following OSes:

Implemented Features:

  • Installs git from packages
  • Optionally installs package from upstream git sources (only on Ubuntu using ppa).
  • Initialising user accounts with git configurations.

Features not yet updated

  • Configure system wide git configurations

Setup

In order to install rehan-git, run the following command:

$ puppet module install rehan-git

The module does expect all the data to be provided through 'Hiera'. See Usage for examples on how to configure it.

Requirements

This module is designed to be as clean and complient with latest puppet code guidelines.

Usage

Classes

git

A basic install with the defaults would be:

include git

Otherwise using the parameters:

  class{ 'git':
    sources_manage  => true,
    sources_repo    => 'ppa:git-core/ppa',
    sources_ensure  => present,
    package_ensure  => latest,
    package_name    => 'git',
  }
Parameters
  • sources_manage: Controls the upstream source management feature. The default is false.
  • sources_repo: Defines the upstream source repository. The default value is OS dependent.
  • sources_ensure: Sets the ensure parameter passed to the upstream source repo repository. The default is present.
  • package_ensure: Sets the ensure parameter passed to the package. The default is latest.
  • package_ensure: Provides the package name to be installed. The default is git.
  • users: A hash of git user profiles, see git:user for more details.

All of this data can be provided through Hiera.

YAML

git::sources_manage: true
git::sources_repo: 'ppa:git-core/ppa'
git::sources_ensure: present
git::package_ensure: latest
git::package_name: 'git'
git::users:
  alice:
    user_email: 'alice@xyz.com'
    user_name: 'Alice Alic'
  bob:
    user_email: 'bob@test.com'
    user_name: 'Bob Builder'
    gitconfig:
      color:
         ui: true
      push:
         default: simple
      pull:
         ff: only
      fetch:
         prune: true

Resources

git::user

This defined type is used to set the per user .gitconfig file. It includes the users' name and email. The username should be a valid user account that has been managed by Puppet. The gitconfig sections is a hash of values that go in the users' .gitconfig file. See git-scm for details.

Usage:

git::user{'alice':
 user_name  => 'Alice Alic',
 user_email => 'alice@xyz.com',
 gitconfig => {
    'color' => {
       ui => true,
    },
    'push' => {
       default => 'simple',
    },
    'pull' => {
       ff => 'only',
    },
    'fetch' => {
       prune => true,
    },
  }
}
Parameters
  • ensure could be set to present or absent, the default is present.
  • user_name sets the user's name to the specified string.
  • user_email sets the user's email address to the specified string.
  • gitconfig A hash of values that go in .gitconfig file of the user., the default is as shown in the example above.

Dependencies

Development

You can submit pull requests and create issues through the official page of this module on GitHub. Please do report any bug and suggest new features/improvements.