12 changes: 12 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,15 @@ Thank you for contributing to this project!
- Our vulnerabilities reporting process is at https://voxpupuli.org/security/
-->
#### Pull Request (PR) description
<!--
Replace this comment with a description of your pull request.
-->

#### This Pull Request (PR) fixes the following issues
<!--
Replace this comment with the list of issues or n/a.
Use format:
Fixes #123
Fixes #124
-->
2 changes: 1 addition & 1 deletion .msync.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
modulesync_config_version: '1.6.0'
modulesync_config_version: '1.9.0'
11 changes: 7 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,17 @@ matrix:
include:
- rvm: 2.1.9
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 4.0" CHECK=test PARALLEL_TEST_PROCESSORS=16
- rvm: 2.4.2
env: PUPPET_VERSION="~> 4.0" CHECK=test PARALLEL_TEST_PROCESSORS=12
- rvm: 2.4.3
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 5.0" CHECK=test_with_coveralls
- rvm: 2.4.2
- rvm: 2.5.0
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 5.0" CHECK=test_with_coveralls
- rvm: 2.4.3
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 5.0" CHECK=rubocop
- rvm: 2.4.2
- rvm: 2.4.3
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 5.0" CHECK=build DEPLOY_TO_FORGE=yes
branches:
Expand Down
55 changes: 34 additions & 21 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,34 @@ All notable changes to this project will be documented in this file.
Each new release typically also includes the latest modulesync defaults.
These should not affect the functionality of the module.

## [v6.3.2](https://github.com/voxpupuli/puppet-r10k/tree/v6.3.2) (2018-01-08)
## [v6.4.0](https://github.com/voxpupuli/puppet-r10k/tree/v6.4.0) (2018-03-28)

[Full Changelog](https://github.com/voxpupuli/puppet-r10k/compare/v6.3.2...v6.4.0)

**Implemented enhancements:**

- Using \#to\_yaml instead of printing each element [\#410](https://github.com/voxpupuli/puppet-r10k/pull/410) ([danzilio](https://github.com/danzilio))

**Fixed bugs:**

- Fix metadata for the deploy task [\#415](https://github.com/voxpupuli/puppet-r10k/pull/415) ([dnlsng](https://github.com/dnlsng))

**Closed issues:**

- r10k deploy not working with a minimal Puppetfile [\#409](https://github.com/voxpupuli/puppet-r10k/issues/409)
- Document bitbucket / stash config / hook\_exe behavior [\#383](https://github.com/voxpupuli/puppet-r10k/issues/383)

**Merged pull requests:**

- bump puppet to latest supported version 4.10.0 [\#417](https://github.com/voxpupuli/puppet-r10k/pull/417) ([bastelfreak](https://github.com/bastelfreak))
- Propose small spelling changes [\#408](https://github.com/voxpupuli/puppet-r10k/pull/408) ([jeis2497052](https://github.com/jeis2497052))
- Restart mcollective if any of the managed files change [\#407](https://github.com/voxpupuli/puppet-r10k/pull/407) ([treydock](https://github.com/treydock))
- Implement locking for mcollective r10k to avoid multiple instances running in parallel [\#406](https://github.com/voxpupuli/puppet-r10k/pull/406) ([treydock](https://github.com/treydock))
- Add LSB tags to the webhook init script. [\#405](https://github.com/voxpupuli/puppet-r10k/pull/405) ([dickp](https://github.com/dickp))
- Add deploy task [\#400](https://github.com/voxpupuli/puppet-r10k/pull/400) ([binford2k](https://github.com/binford2k))
- add documentation for bitbucket webhook [\#384](https://github.com/voxpupuli/puppet-r10k/pull/384) ([khaefeli](https://github.com/khaefeli))

## [v6.3.2](https://github.com/voxpupuli/puppet-r10k/tree/v6.3.2) (2018-01-09)

[Full Changelog](https://github.com/voxpupuli/puppet-r10k/compare/v6.3.1...v6.3.2)

Expand All @@ -26,10 +53,6 @@ These should not affect the functionality of the module.
- syntax errors when starting the webhook [\#394](https://github.com/voxpupuli/puppet-r10k/issues/394)
- Fix typo in webhook [\#396](https://github.com/voxpupuli/puppet-r10k/pull/396) ([alexjfisher](https://github.com/alexjfisher))

**Merged pull requests:**

- release 6.3.0 [\#393](https://github.com/voxpupuli/puppet-r10k/pull/393) ([bastelfreak](https://github.com/bastelfreak))

## [v6.3.0](https://github.com/voxpupuli/puppet-r10k/tree/v6.3.0) (2017-11-26)

[Full Changelog](https://github.com/voxpupuli/puppet-r10k/compare/v6.2.0...v6.3.0)
Expand All @@ -53,7 +76,6 @@ These should not affect the functionality of the module.

**Merged pull requests:**

- release 6.2.0 [\#388](https://github.com/voxpupuli/puppet-r10k/pull/388) ([bastelfreak](https://github.com/bastelfreak))
- Add logging messages [\#385](https://github.com/voxpupuli/puppet-r10k/pull/385) ([amateo](https://github.com/amateo))

## [v6.1.0](https://github.com/voxpupuli/puppet-r10k/tree/v6.1.0) (2017-06-24)
Expand All @@ -71,7 +93,6 @@ These should not affect the functionality of the module.
- Better handling for the default branch [\#376](https://github.com/voxpupuli/puppet-r10k/pull/376) ([rnelson0](https://github.com/rnelson0))
- Add Troubleshooting section \(logfile, heartbeat\) to README [\#375](https://github.com/voxpupuli/puppet-r10k/pull/375) ([bittner](https://github.com/bittner))
- Fix github license detection [\#372](https://github.com/voxpupuli/puppet-r10k/pull/372) ([alexjfisher](https://github.com/alexjfisher))
- Release 6.0.0 [\#371](https://github.com/voxpupuli/puppet-r10k/pull/371) ([dhollinger](https://github.com/dhollinger))

## [v6.0.0](https://github.com/voxpupuli/puppet-r10k/tree/v6.0.0) (2017-05-10)

Expand All @@ -95,7 +116,6 @@ These should not affect the functionality of the module.
**Merged pull requests:**

- Webhook: ability to pass extra arguments to mco [\#363](https://github.com/voxpupuli/puppet-r10k/pull/363) ([nike38rus](https://github.com/nike38rus))
- Release 5.0.2 [\#361](https://github.com/voxpupuli/puppet-r10k/pull/361) ([dhollinger](https://github.com/dhollinger))
- use stdlib puppet facts for configuration [\#352](https://github.com/voxpupuli/puppet-r10k/pull/352) ([vchepkov](https://github.com/vchepkov))
- Added /heartbeat url endpoint to webhook [\#272](https://github.com/voxpupuli/puppet-r10k/pull/272) ([thebaron](https://github.com/thebaron))

Expand All @@ -122,7 +142,6 @@ These should not affect the functionality of the module.

**Merged pull requests:**

- Release 5.0.1 [\#358](https://github.com/voxpupuli/puppet-r10k/pull/358) ([bastelfreak](https://github.com/bastelfreak))
- puppet-lint: fix arrow\_on\_right\_operand\_line [\#357](https://github.com/voxpupuli/puppet-r10k/pull/357) ([bastelfreak](https://github.com/bastelfreak))
- Create sanitize\_input helper method for strings sent to run\_command method. [\#356](https://github.com/voxpupuli/puppet-r10k/pull/356) ([xraystyle](https://github.com/xraystyle))
- Use styleguide compliant syntax for sshkey example. [\#353](https://github.com/voxpupuli/puppet-r10k/pull/353) ([kallies](https://github.com/kallies))
Expand All @@ -139,7 +158,6 @@ These should not affect the functionality of the module.

**Merged pull requests:**

- Release 5.0.0 [\#347](https://github.com/voxpupuli/puppet-r10k/pull/347) ([rnelson0](https://github.com/rnelson0))
- r10k.yaml contents indentation is incorrect [\#345](https://github.com/voxpupuli/puppet-r10k/pull/345) ([Kotty666](https://github.com/Kotty666))
- Update yaml location for \>PE3 [\#343](https://github.com/voxpupuli/puppet-r10k/pull/343) ([rnelson0](https://github.com/rnelson0))
- replace all validate functions with datatypes [\#341](https://github.com/voxpupuli/puppet-r10k/pull/341) ([bastelfreak](https://github.com/bastelfreak))
Expand Down Expand Up @@ -177,7 +195,6 @@ These should not affect the functionality of the module.

**Merged pull requests:**

- Release 4.1.0 [\#325](https://github.com/voxpupuli/puppet-r10k/pull/325) ([rnelson0](https://github.com/rnelson0))
- \(GH323\) Better parameterization of root user/group from \#279 [\#324](https://github.com/voxpupuli/puppet-r10k/pull/324) ([rnelson0](https://github.com/rnelson0))
- Fix rubocop failures from \#268 [\#322](https://github.com/voxpupuli/puppet-r10k/pull/322) ([rnelson0](https://github.com/rnelson0))
- Bump minimum version dependencies \(for Puppet 4\) [\#318](https://github.com/voxpupuli/puppet-r10k/pull/318) ([juniorsysadmin](https://github.com/juniorsysadmin))
Expand All @@ -192,17 +209,12 @@ These should not affect the functionality of the module.

**Merged pull requests:**

- Release 4.0.2 [\#305](https://github.com/voxpupuli/puppet-r10k/pull/305) ([rnelson0](https://github.com/rnelson0))
- Changelog for 4.0.1 [\#304](https://github.com/voxpupuli/puppet-r10k/pull/304) ([rnelson0](https://github.com/rnelson0))

## [v4.0.1](https://github.com/voxpupuli/puppet-r10k/tree/v4.0.1) (2016-11-20)

[Full Changelog](https://github.com/voxpupuli/puppet-r10k/compare/v4.0.0...v4.0.1)

**Merged pull requests:**

- Release 4.0.1 [\#303](https://github.com/voxpupuli/puppet-r10k/pull/303) ([rnelson0](https://github.com/rnelson0))

## [v4.0.0](https://github.com/voxpupuli/puppet-r10k/tree/v4.0.0) (2016-11-20)

[Full Changelog](https://github.com/voxpupuli/puppet-r10k/compare/v3.2.0...v4.0.0)
Expand All @@ -217,9 +229,7 @@ These should not affect the functionality of the module.

**Merged pull requests:**

- Reformat release header for 4.0.0 [\#302](https://github.com/voxpupuli/puppet-r10k/pull/302) ([rnelson0](https://github.com/rnelson0))
- Rename CHANGELOG.md [\#301](https://github.com/voxpupuli/puppet-r10k/pull/301) ([rnelson0](https://github.com/rnelson0))
- Release candidate for v4.0.0 [\#299](https://github.com/voxpupuli/puppet-r10k/pull/299) ([rnelson0](https://github.com/rnelson0))
- Fixes Puppet 4 path for webhook [\#295](https://github.com/voxpupuli/puppet-r10k/pull/295) ([andrewwippler](https://github.com/andrewwippler))
- Update config\_version.sh [\#291](https://github.com/voxpupuli/puppet-r10k/pull/291) ([seanscottking](https://github.com/seanscottking))
- Fix testing [\#288](https://github.com/voxpupuli/puppet-r10k/pull/288) ([ghoneycutt](https://github.com/ghoneycutt))
Expand Down Expand Up @@ -324,7 +334,7 @@ These should not affect the functionality of the module.

[Full Changelog](https://github.com/voxpupuli/puppet-r10k/compare/v2.8.2...v2.8.3)

**Fixed bugs:**
**Implemented enhancements:**

- \[Bug\] Webhook does not support Ping event from GitHub [\#89](https://github.com/voxpupuli/puppet-r10k/issues/89)

Expand Down Expand Up @@ -429,10 +439,13 @@ These should not affect the functionality of the module.

[Full Changelog](https://github.com/voxpupuli/puppet-r10k/compare/v2.7.0...v2.7.1)

**Implemented enhancements:**

- /var/log/webhook permissions not managed properly [\#144](https://github.com/voxpupuli/puppet-r10k/issues/144)

**Fixed bugs:**

- Sinatra gem required for PE webhook? [\#154](https://github.com/voxpupuli/puppet-r10k/issues/154)
- /var/log/webhook permissions not managed properly [\#144](https://github.com/voxpupuli/puppet-r10k/issues/144)

**Merged pull requests:**

Expand Down Expand Up @@ -901,4 +914,4 @@ These should not affect the functionality of the module.



\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def location_for(place, fake_version = nil)
end

group :test do
gem 'puppetlabs_spec_helper', '~> 2.5.0', :require => false
gem 'puppetlabs_spec_helper', '~> 2.6.0', :require => false
gem 'rspec-puppet', '~> 2.5', :require => false
gem 'rspec-puppet-facts', :require => false
gem 'rspec-puppet-utils', :require => false
Expand Down Expand Up @@ -57,7 +57,7 @@ group :system_tests do
end

group :release do
gem 'github_changelog_generator', :require => false, :git => 'https://github.com/skywinder/github-changelog-generator'
gem 'github_changelog_generator', :require => false, :git => 'https://github.com/skywinder/github-changelog-generator' if RUBY_VERSION >= '2.2.2'
gem 'puppet-blacksmith', :require => false
gem 'voxpupuli-release', :require => false, :git => 'https://github.com/voxpupuli/voxpupuli-release-gem'
gem 'puppet-strings', '~> 1.0', :require => false
Expand Down
55 changes: 45 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

This module was built to install and configure r10k. It has a base class to configure r10k to
synchronize [dynamic environments](https://github.com/adrienthebo/r10k/blob/master/doc/dynamic-environments.mkd).
It also has a series of lateral scripts and tools that assist in general workflow, that will be seperated into
It also has a series of lateral scripts and tools that assist in general workflow, that will be separated into
their own modules into the future.

## Module Description
Expand All @@ -37,7 +37,7 @@ Please refer to the official [r10k docs](https://github.com/puppetlabs/r10k/tree

### Prefix Example
Instead of passing a single `remote`, you can pass a puppet [hash](https://docs.puppetlabs.com/puppet/latest/reference/lang_datatypes.html#hashes) as the `sources`
parameter. This allows you to configure r10k with [prefix](https://github.com/puppetlabs/r10k/blob/910709a2924d6167e2e53e03d64d2cc1a64827d4/doc/dynamic-environments/configuration.mkd#prefix) support. This often used when multiple teams use seperate repos, or if hiera and puppet are distributed across two repos.
parameter. This allows you to configure r10k with [prefix](https://github.com/puppetlabs/r10k/blob/910709a2924d6167e2e53e03d64d2cc1a64827d4/doc/dynamic-environments/configuration.mkd#prefix) support. This often used when multiple teams use separate repos, or if hiera and puppet are distributed across two repos.

```puppet
class { 'r10k':
Expand Down Expand Up @@ -242,7 +242,7 @@ This will remove the mcollective agent/application and ddl files from disk. This

# Webhook Support

![alt tag](https://gist.githubusercontent.com/acidprime/be25026c11a76bf3e7fb/raw/44df86181c3e5d14242a1b1f4281bf24e9c48509/webhook.gif)
![alt tag](https://gist.githubusercontent.com/acidprime/be25026c11a76bf3e7fb/raw/44df86181c3e5d14242a1b1f4281bf24e9c48509/webhook.gif)
For version control systems that use web driven post-receive processes you can use the example webhook included in this module.
When the webhook receives the post-receive event, it will synchronize environments on your puppet masters.
The webhook uses mcollective for multi-master synchronization and the `peadmin` user from Puppet Enterprise by default.
Expand Down Expand Up @@ -349,6 +349,42 @@ git_webhook { 'web_post_receive_webhook_for_module' :
provider => 'github',
}
```
### Webhook Bitbucket Example
This is an example of using the webhook with Atlassian Bitbucket (former Stash).
Requires the `external hooks` addon by https://marketplace.atlassian.com/plugins/com.ngs.stash.externalhooks.external-hooks/server/overview
and a specific Bitbucket user/pass.
Remember to place the `stash_mco.rb` on the bitbucket server an make it executable.
Enable the webhook over the repository settings `External Async Post Receive Hook`:
- Executable: e.g. `/opt/atlassian/bitbucket-data/external-hooks/stash_mco.rb` (see hook_exe)
- Positional parameters: `-t http://git.example.com:8088/payload`

```puppet
# Add deploy key
git_deploy_key { 'add_deploy_key_to_puppet_control':
ensure => present,
name => $::fqdn,
path => '/root/.ssh/id_rsa.pub',
username => 'api',
password => 'pass',
project_name => 'project',
repo_name => 'puppet',
server_url => 'https://git.example.com',
provider => 'stash',
}
# Add webhook
git_webhook { 'web_post_receive_webhook' :
ensure => present,
webhook_url => 'https://puppet:puppet@hole.in.firewall:8088/module',
password => 'pass',
username => 'api',
project_name => 'project',
repo_name => 'puppet',
server_url => 'https://git.example.com',
provider => 'stash',
hook_exe => '/opt/atlassian/bitbucket-data/external-hooks/stash_mco.rb',
}
```

### GitHub Secret Support
GitHub webhooks allow the use of a secret value that gets hashed against the payload to pass a
Expand Down Expand Up @@ -522,7 +558,7 @@ class { 'r10k::webhook::config':

### Webhook Default Branch

The default branch of the controlrepo is commonly called `production`. This value can be overriden if you use another default branch name, such as `master`.
The default branch of the controlrepo is commonly called `production`. This value can be overridden if you use another default branch name, such as `master`.

```puppet
class { 'r10k::webhook::config':
Expand All @@ -537,7 +573,7 @@ To aid in debugging, or to give you some hints as to how to trigger the webhook
```bash
curl -d '
{
"repository": {"name": "foo", "owner": {"login": "foo"}},
"repository": {"name": "foo", "owner": {"login": "foo"}},
"ref": "production"
}' http://puppet-master.example:8088/payload
```
Expand Down Expand Up @@ -572,7 +608,7 @@ The following is an example of declaring the webhook without a background mode
```puppet
class { 'r10k::webhook':
. . .
background => false
background => false
}
```

Expand All @@ -582,7 +618,7 @@ If you need to configure webhook to not trigger r10k when changes pushed in some
`r10k::webhook::config::ignore_environments` parameter as array.
There is an ability to specify it as a regular expression by enclosing it in forward slashes.

Here is an example where the test branch in dev repository and all branches in all repositories that includes the word 'feature'
Here is an example where the test branch in dev repository and all branches in all repositories that includes the word 'feature'
in names will be skipped:

```puppet
Expand Down Expand Up @@ -728,7 +764,7 @@ boolean if to manage symlink

##### `include_prerun_command`
Deprecated: Add [prerun_command](https://docs.puppetlabs.com/references/latest/configuration.html#preruncommand) to puppet.conf to run r10k when the agent on the master runs.
Suggest instead declaring `r10k::postrun_command ` as that will run after the agent runs which prevents r10k from stopping configuration management of masters from occuring as it does with `prerun_command`s
Suggest instead declaring `r10k::postrun_command ` as that will run after the agent runs which prevents r10k from stopping configuration management of masters from occurring as it does with `prerun_command`s

##### `include_postrun_command`
```
Expand All @@ -744,7 +780,7 @@ The 4.1.x release *deprecates* support for:
* Puppet 3
* Ruby 1.9.3

These items are are planned for removal in v5.0.0.
These items are planned for removal in v5.0.0.

## Support

Expand Down Expand Up @@ -776,4 +812,3 @@ Quickstart:
```

Check the .travis.yml for supported Operating System Versions

6 changes: 5 additions & 1 deletion manifests/mcollective.pp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@
}

Service <| title == $mc_service |> {
subscribe +> [ File["${app_path}/${app_name}"], File["${agent_path}/${agent_ddl}"] ],
subscribe +> [
File['mcollective_agent_executable'],
File['mcollective_agent_ddl'],
File['mcollective_application_file']
],
}
}
4 changes: 2 additions & 2 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"author": "Vox Pupuli",
"license": "Apache-2.0",
"name": "puppet-r10k",
"version": "6.3.2",
"version": "6.4.0",
"operatingsystem_support": [
{
"operatingsystem": "RedHat",
Expand Down Expand Up @@ -88,7 +88,7 @@
"requirements": [
{
"name": "puppet",
"version_requirement": ">= 4.7.1 < 6.0.0"
"version_requirement": ">= 4.10.0 < 6.0.0"
}
]
}
2 changes: 2 additions & 0 deletions spec/acceptance/nodesets/docker/ubuntu-16.04.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ HOSTS:
docker_preserve_image: true
docker_cmd: '["/sbin/init"]'
docker_image_commands:
- 'systemctl mask getty@tty1.service getty-static.service'
- 'apt-get install -y net-tools wget locales apt-transport-https'
- 'locale-gen en_US.UTF-8'
- 'echo LANG=en_US.UTF-8 > /etc/default/locale'
CONFIG:
trace_limit: 200
masterless: true
Expand Down
2 changes: 0 additions & 2 deletions spec/acceptance/nodesets/fedora-25-x64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
# https://github.com/voxpupuli/modulesync
# https://github.com/voxpupuli/modulesync_config
#
# platform is fedora 24 because there is no
# puppet-agent for fedora 25 by 2016-12-30
HOSTS:
fedora-25-x64:
roles:
Expand Down
Loading