Version information
This version is compatible with:
- , ,
Start using this module
Add this module to your Puppetfile:
mod 'locp-gitssh', '0.1.3'
Learn more about managing modules with a PuppetfileDocumentation
gitssh
Table of Contents
- Overview
- Module Description - What the module does and why it is useful
- Setup - The basics of getting started with gitssh
- Usage - Configuration options and additional functionality
- Reference - An under-the-hood peek at what the module is doing and how
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
Overview
A Puppet module to install a basic Git SSH server. It also manages SSH client access and repositories.
Module Description
This module installs the git package and configures a 'git' user with the
/usr/bin/git-shell
shell.
SSH clients can be configured using the gitssh::client
definition and
repositories can be added/removed using the gitssh::repo
definition.
Setup
What gitssh affects
-
Adds /usr/bin/git-shell to /etc/shells.
-
By default, the following directory tree is created:
/var/git /var/git/.ssh
Beginning with gitssh
As with most modules, the most basic way to use the module would be:
include '::gitssh'
Usage
The following code will:
- Setup a Git SSH server with default settings
- Create two clients/users (nick@magpie.puppetlabs.lan and fbl42)
- Ensure that if a client jbi72 does not have access
include '::gitssh'
gitssh::client { 'nick@magpie.puppetlabs.lan':
key => 'AAAAB...aQ==',
}
gitssh::client { 'fbl42':
key => 'AAAAB...Aq==',
}
gitssh::client { 'jbi72':
ensure => absent
}
The following snippet will create two repositories (foo and bar) and will ensure that any repository called deleteme is absent:
include '::gitssh'
gitssh::repo { 'foo': }
gitssh::repo { 'bar': }
gitssh::repo { 'deleteme':
ensure => absent
}
Hiera
The following Hiera code will reproduce the examples above:
---
gitssh::clients:
nick@magpie.puppetlabs.lan:
key: 'AAAAB...aQ=='
fbl42:
key: 'AAAAB...Aq=='
jbi72:
ensure: absent
gitssh::repos:
foo:
ensure: present
bar:
ensure: present
deleteme:
ensure: absent
Reference
Parameters
Defined type gitssh::client
ensure
If the SSH key is to be present in the git account. Valid values are present and absent. Default value: present
type
The type of SSH key. See here for a list of valid values. Default value: 'ssh-rsa'
key
This value can be left as undef (the default) if ensure
is set to
absent. Otherwise it should be the SSH key.
Default value: undef
Class gitssh
basedir
This is set as the home directory for the git user. Default value: '/var/git'
clients
An array of hashes that can be passed to the gitssh::client
definition.
Default value: []
package_ensure
Passed as the ensure attribute to the package resource. Valid values are present or a specific version number. Default value: present
package_name
Passed as the name attribute for the package resource for the git package. Default value: 'git'
purge_ssh_keys
Passed as an attribute for the user resource for git. This will remove all SSH keys from the git user that are not controlled by Puppet. This attribute has no effect on version of Puppet < 3.6.0 and will generate a warning unless set to false. Default value: true
repos
An array of hashes that can be passed to the gitssh::repo
definition.
Default value: []
Defined type gitssh::repo
ensure
If the repository is to be present or absent. Default value: present
Limitations
Currently only developed and tested on CentOS 7, Ubuntu 14.04 and Debian 7.
Development
Contributions will be gratefully accepted. Please go to the project page, fork the project, make your changes locally and then raise a pull request. Details on how to do this are available at https://guides.github.com/activities/contributing-to-open-source.
Contributers
Release | Issue/PR | Contributer |
---|---|---|
0.1.2 | The module does not work on Puppet 3.4.3 | @nl0pvm |
Change Log for Puppet Module locp-gitssh
##2016-09-21 - Release 0.1.3 (diff)
- Fixed a typo in the README.
- Clarified the licence.
##2016-09-21 - Release 0.1.2 (diff)
- Fixed a fatal error when running a Puppet version < 3.6.0.
- Improved unit and acceptance testing.
- Improved the documentation.
##2016-09-18 - Release 0.1.1 (diff)
- Ensure the service runs on Red Hat and Debian families.
- Improved the project metadata.
##2016-09-11 - Release 0.1.0
An initial release.
Dependencies
- puppetlabs-stdlib (>= 3.0.0 < 5.0.0)
Copyright 2016 League of Crafty Programmers Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.