Forge Home


Install/update software from git repositories


7,102 latest version

4.6 quality score

Version information

  • 1.0.0 (latest)
released Mar 31st 2016
This version is compatible with:
  • , , , ,

Start using this module

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

Add this module to your Puppetfile:

mod 'justinjl-gitclone', '1.0.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add justinjl-gitclone
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install justinjl-gitclone --version 1.0.0

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.



justinjl/gitclone — version 1.0.0 Mar 31st 2016



Puppet module to clone git repositoroes.

Module Description

A simple module to clone git repositoroes. Useful when you need to install software from git rather than apt/yum.

Can also periodically update (git pull) repositories at scheduled intervals.


What gitclone affects

  • Installs git via system package manager.
  • Optionally clones and updates git repositories when gitclone::repo type is called.

Setup Requirements OPTIONAL

Beginning with gitclone

The module can be included with default values:

include '::gitclone'
gitclone::repo { 'hellogitworld' :
    source      => '',
    destination => '/tmp/hellogitworld',
    owner       => 'nobody',
    group       => 'nogroup',



The module can be included with default values as in the above example, or explicitly defined to override with custom parameters. The parameters and their defaults are listed below.

Class { '::gitclone' :
    package_manage  => true,
    package_name    => 'git',
    package_ensure  => 'present',


Parameters within gitclone:

  • package_manage: Optional. Whether to install git package. Defaults to true. Setting to false will just assume git is installed.
  • package_name: Optional. Name of git package to install. Defaults to 'git'.
  • package_ensure: Optional. Ensure value to pass to Puppet's Package type. Value must be one of 'present','installed','latest','held'. Defaults to 'present'.


The gitclone::repo type is used to define the repository to clone/update.

gitclone::repo { 'hellogitworld' :
    source      => '',
    destination => '/tmp/hellogitworld',
    owner       => 'nobody',
    group       => 'nogroup',
    depth       => 'all',
    branch      => 'master',
    update      => 'never',

Parameters within gitclone::repo:

  • source: Required. URI of git repository to clone.
  • destination: Required. Local directory to clone repository to.
  • owner: Required. Username/UID to chown to after git clone/pull.
  • group: Required. Group/GID to chown to after git clone/pull.
  • depth: Optional. Only clone last x revistions. Defaults to 'all'.
  • branch: Optional. Branch to checkout after clone.
  • update: Optional. Update cloned repo via git pull every never, hourly, daily, weekly, monthly


Public classes

  • gitclone: The main class to include this module.

Private classes

  • gitclone::package: Class to install git package.


  • gitclone::repo: Type to clone/update a git repository.


This module has been made for (osfamily) Debian and RedHat (and their derivatives), however it should work fine on any 'nix so long as git is installed or installable.


Appreciate any suggestions on feature or code changes. Let me know if you want to contribute or collaborate.