Showing with 43 additions and 14 deletions.
  1. +3 −1 CHANGELOG
  2. +1 −1 Modulefile
  3. +39 −12 README.md
4 changes: 3 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
2.4.3 - Zack Smith
* Documentation Updates
2.4.1 - Zack Smith
* Documentation Updates
2.4.0 - Zack Smith
* Bump r10k version
2.3.4 - Eli Young
2.3.3 - Eli Young
* Webhook fixes for reboots + refreshes
2.3.2 - Zach Leslie + misterdom
* Fix for #97
Expand Down
2 changes: 1 addition & 1 deletion Modulefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name 'zack-r10k'
version '2.4.2'
version '2.4.3'
source 'https://github.com/acidprime/r10k'
author 'zack'
license 'Apache License, Version 2.0'
Expand Down
51 changes: 39 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Build Status](https://travis-ci.org/acidprime/r10k.png?branch=master)](https://travis-ci.org/acidprime/r10k)

This is the r10k setup module. It has a base class to configure r10k to
synchronize dynamic environments. You can be simply used by declaring it:
synchronize [dynamic environments](https://github.com/adrienthebo/r10k/blob/master/doc/dynamic-environments.mkd). You can be simply used by declaring it:

```puppet
class { 'r10k':
Expand All @@ -18,12 +18,31 @@ class { 'r10k':
provider => 'pe_gem',
}
```
### Prefixes
Installing using prefixes for multiple control repos.
```puppet
class { 'r10k':
sources => {
'webteam' => {
'remote' => 'ssh://git@github.com/webteam/somerepo.git',
'basedir' => "${::settings::confdir}/environments"
'prefix' => true,
},
'secteam' => {
'remote' => 'ssh://git@github.com/secteam/someotherrepo.git',
'basedir' => '/some/other/basedir'
'prefix' => true,
},
},
}
```


## Version chart

| Module Version | r10k Version |
| -------------- | ------------ |
| v2.4.0 | 1.3.5 |
| v2.4.+ | 1.3.5 |
| v2.3.1 | 1.3.4 |
| v2.3.0 | 1.3.2 |
| v2.2.8 | 1.3.1 |
Expand All @@ -34,6 +53,7 @@ This will configure `/etc/r10k.yaml` and install the r10k gem after installing
ruby using the [puppetlabs/ruby](http://forge.puppetlabs.com/puppetlabs/ruby) module.

Here is an example of deploying the ssh keys needed for r10k to connect to a repo called puppet/control on a gitlab server.
This is helpful when you need to automatically deploy new masters
```puppet
#https://docs.puppetlabs.com/references/latest/type.html#sshkey
sshkey { "your.internal.gitlab.server.com":
Expand Down Expand Up @@ -95,9 +115,7 @@ r10k::manage_configfile_symlink: true
r10k::configfile_symlink: /etc/r10k.yaml
```
## Alternative install
## Example installs
Installing using a proxy server
Expand Down Expand Up @@ -203,10 +221,11 @@ You can sync an individual environment using:
```shell
mco r10k deploy <environment>
```
Note: This implies `-p`

An example post-recieve hook is included in the files directory.
This hook can automatically cause code to synchronize on your
servers at time of push in git.
servers at time of push in git. More modern git systems use webhooks, for those see below.

###Install mcollective support for post recieve hooks
Install the `mco` command from the puppet enterprise installation directory i.e.
Expand Down Expand Up @@ -236,7 +255,6 @@ and copy the certs to somewhere that is readable by the respective user.
/home/gitolite/.mcollective.d/peadmin-public.pem
~~~
_Note: PE2 only requires the .mcollective file as the default auth was psk_
##Support

# Webhook Support

Expand All @@ -249,7 +267,14 @@ Currently this is a feature Puppet Enterprise only.

### Webhook Prefix Example

The following is an example of declaring the webhook when r10k prefixing is enabled
The following is an example of declaring the webhook when r10k [prefixing](#prefixes) are enabled.

#### prefix_command.rb
This script is fed the github/gitlab payload in via stdin. This script is meant to return the prefix as its output.
This is needed as the payload does not contain the r10k prefix. The simplest way to determine the prefix is to
use the remote url in the payload and find the respective key in r10k.yaml. An example prefix command is located in
this repo [here](https://github.com/acidprime/r10k/blob/master/files/prefix_command.rb). Note that you may need to
modify this script depending on your remote configuration to use one of the various remote styles.

```puppet
file {'/usr/local/bin/prefix_command.rb':
Expand All @@ -270,13 +295,13 @@ class {'r10k::webhook::config':
class {'r10k::webhook':
require => Class['r10k::webhook::config'],
}
# Deploy this webhook to your local gitlab server for the puppet/control repo.
# https://github.com/abrader/abrader-gms
git_webhook { 'web_post_receive_webhook' :
ensure => present,
webhook_url => 'https://puppet:puppet@master.of.masters:8088/payload',
token => hiera('gitlab_api_token'),
project_name => 'puppet/controle',
project_name => 'puppet/control',
server_url => 'http://your.internal.gitlab.com',
provider => 'gitlab',
}
Expand All @@ -285,6 +310,9 @@ git_webhook { 'web_post_receive_webhook' :
```

### Webhook Non authenticated example
This is an example of using the webhok without authentication
The `git_webhook` type will using the [api token](https://help.github.com/articles/creating-an-access-token-for-command-line-use/) to add the webhook to the "control" repo that contains your puppetfile. This is typically useful when you want all automate the addtion of the webhook to the repo.

```puppet
class {'r10k::webhook::config':
enable_ssl => false,
Expand All @@ -307,7 +335,6 @@ git_webhook { 'web_post_receive_webhook' :
}
```



##Support

Please log tickets and issues at our [Projects site](https://github.com/acidprime/r10k/issues)