local_git_repo
Version information
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
Add this module to your Puppetfile:
mod 'puppetfinland-local_git_repo', '0.1.0'
Learn more about managing modules with a PuppetfileDocumentation
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:
- https://forge.puppet.com/modules/puppet/posix_acl
- https://forge.puppet.com/modules/puppetlabs/stdlib
- https://forge.puppet.com/modules/puppetlabs/vcsrepo
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.
Dependencies
- puppet/posix_acl (>= 2.0.0 < 3.0.0)
- puppetlabs/stdlib (>= 8.0.0 < 9.0.0)
- puppetlabs/vcsrepo (>= 5.0.0 < 6.0.0)
Copyright 2022 OpenVPN, Inc Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.