Forge Home

local_git_repo

Manage local Git repos, share them with Git protocol and allow co-operation with extended ACLs

323 downloads

323 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

  • 0.1.0 (latest)
released Jul 12th 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
  • Puppet >= 6.21.0 < 8.0.0
  • , , , ,

Start using this module

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

Add this module to your Puppetfile:

mod 'puppetfinland-local_git_repo', '0.1.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add puppetfinland-local_git_repo
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install puppetfinland-local_git_repo --version 0.1.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.

Download

Documentation

puppetfinland/local_git_repo — version 0.1.0 Jul 12th 2022

local_git_repo

Clone a Git repository and use POSIX extended ACLs to grant access to it.

Prerequisites

This module depends on three external modules:

Usage

Example usage with one allowed group:

$group = 'developers'

local_git_repo::instance { 'myrepo':
  git_url        => 'https://git.example.org/myrepo.git',
  target_dir     => '/var/lib/repos/myrepo',
  permissions    => [ 'default:mask::rwx',
                      'mask::rwx',
                      "default:g:${group}:rwx",
                      "g:${group}:rwx", ],
}

Example usage with two allowed groups:

$group = 'developers'
$another_group = 'devops'

local_git_repo::instance { 'myrepo':
  git_url        => 'https://git.example.org/myrepo.git',
  target_dir     => '/var/lib/repos/myrepo',
  permissions    => [ 'default:mask::rwx',
                      'mask::rwx',
                      "default:g:${group}:rwx",
                      "g:${group}:rwx",
                      "default:g:${another_group}:rwx",
                      "g:${another_group}:rwx", ],
}

If add additional permissions later, you need to manually set the acls for existing files. Whatever defaults you may have set will not be automatically propagated to directories or files that have been created prior to your changes. Here's an example:

setfacl -R -m 'group:devops:rwx' myrepo/
setfacl -R -m 'default:group:devops:rwx' myrepo/

To share the Git repository with git-daemon using Git protocol (currently Ubuntu/Debian only):

class { 'local_git_repo::gitdaemon':
  base_path => '/var/lib/repos',
  directory => '/var/lib/repos/myrepo',
}

The directory parameter is the directory whitelist. Directories not on the whitelist will not be exported by git-daemon. Based on git-daemon documentation it should accept a string with multiple directories separated by a space.