11 changes: 7 additions & 4 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,18 +232,21 @@ simple tests against it after applying the module. You can run this
with:

```sh
BEAKER_setfile=debian11-64 bundle exec rake beaker
BEAKER_PUPPET_COLLECTION=puppet7 BEAKER_setfile=debian11-64 bundle exec rake beaker
```

You can replace the string `debian10` with any common operating system.
You can replace the string `debian11` with any common operating system.
The following strings are known to work:

* ubuntu1804
* ubuntu2004
* debian10
* ubuntu2204
* debian11
* centos7
* centos8
* centos9
* almalinux8
* almalinux9
* fedora36

For more information and tips & tricks, see [voxpupuli-acceptance's documentation](https://github.com/voxpupuli/voxpupuli-acceptance#running-tests).

Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,3 @@ jobs:
puppet:
name: Puppet
uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v1
with:
pidfile_workaround: 'false'
2 changes: 1 addition & 1 deletion .msync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/

modulesync_config_version: '6.0.0'
modulesync_config_version: '7.0.0'
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,26 @@ 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.

## [v12.2.0](https://github.com/voxpupuli/puppet-r10k/tree/v12.2.0) (2023-10-05)

[Full Changelog](https://github.com/voxpupuli/puppet-r10k/compare/v12.1.1...v12.2.0)

**Implemented enhancements:**

- webhook: Update default version 2.1.0-\>2.2.0 [\#631](https://github.com/voxpupuli/puppet-r10k/pull/631) ([bastelfreak](https://github.com/bastelfreak))
- Implement acceptance tests for webhook-go [\#627](https://github.com/voxpupuli/puppet-r10k/pull/627) ([bastelfreak](https://github.com/bastelfreak))
- webhook: Allow people to host the repo on their own [\#626](https://github.com/voxpupuli/puppet-r10k/pull/626) ([bastelfreak](https://github.com/bastelfreak))

**Fixed bugs:**

- webhook: Fix default parameter values and add unit tests [\#630](https://github.com/voxpupuli/puppet-r10k/pull/630) ([bastelfreak](https://github.com/bastelfreak))

**Merged pull requests:**

- replace to\_yaml\(\) with stdlib::to\_yaml\(\) [\#632](https://github.com/voxpupuli/puppet-r10k/pull/632) ([bastelfreak](https://github.com/bastelfreak))
- puppet/systemd: Allow 6.x [\#629](https://github.com/voxpupuli/puppet-r10k/pull/629) ([bastelfreak](https://github.com/bastelfreak))
- webhook-go: Move static data from params to webhook class [\#628](https://github.com/voxpupuli/puppet-r10k/pull/628) ([bastelfreak](https://github.com/bastelfreak))

## [v12.1.1](https://github.com/voxpupuli/puppet-r10k/tree/v12.1.1) (2023-08-12)

[Full Changelog](https://github.com/voxpupuli/puppet-r10k/compare/v12.1.0...v12.1.1)
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
source ENV['GEM_SOURCE'] || 'https://rubygems.org'

group :test do
gem 'voxpupuli-test', '~> 6.0', :require => false
gem 'voxpupuli-test', '~> 7.0', :require => false
gem 'coveralls', :require => false
gem 'simplecov-console', :require => false
gem 'puppet_metadata', '~> 3.0', :require => false
Expand Down
63 changes: 36 additions & 27 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* [`r10k::params`](#r10k--params): Reasonable defaults for all classes
* [`r10k::postrun_command`](#r10k--postrun_command): This class will configure r10k to run as part of the masters agent run
* [`r10k::prerun_command`](#r10k--prerun_command): This class will configure r10k to run as part of the masters agent run
* [`r10k::webhook`](#r10k--webhook): Class: r10k::webhook
* [`r10k::webhook`](#r10k--webhook): install and configure the webhook-go package as local webhook receiver to trigger r10k runs
* [`r10k::webhook::config`](#r10k--webhook--config): Class: r10k::webhook::config
* [`r10k::webhook::package`](#r10k--webhook--package): Class: r10k::webhook::package
* [`r10k::webhook::service`](#r10k--webhook--service): Class: r10k::webhook::service
Expand Down Expand Up @@ -551,12 +551,13 @@ Default value: `'present'`

### <a name="r10k--webhook"></a>`r10k::webhook`

Class: r10k::webhook
install and configure the webhook-go package as local webhook receiver to trigger r10k runs

#### Parameters

The following parameters are available in the `r10k::webhook` class:

* [`install_method`](#-r10k--webhook--install_method)
* [`ensure`](#-r10k--webhook--ensure)
* [`version`](#-r10k--webhook--version)
* [`service_ensure`](#-r10k--webhook--service_ensure)
Expand All @@ -569,21 +570,29 @@ The following parameters are available in the `r10k::webhook` class:
* [`r10k`](#-r10k--webhook--r10k)
* [`config`](#-r10k--webhook--config)

##### <a name="-r10k--webhook--install_method"></a>`install_method`

Data type: `Enum['package', 'repo', 'none']`

how the package should be installed

Default value: `'package'`

##### <a name="-r10k--webhook--ensure"></a>`ensure`

Data type: `Boolean`



Default value: `$r10k::params::webhook_ensure`
Default value: `false`

##### <a name="-r10k--webhook--version"></a>`version`

Data type: `String`



Default value: `$r10k::params::webhook_version`
Default value: `'2.2.0'`

##### <a name="-r10k--webhook--service_ensure"></a>`service_ensure`

Expand All @@ -598,15 +607,15 @@ Variant[



Default value: `$r10k::params::webhook_service_ensure`
Default value: `'running'`

##### <a name="-r10k--webhook--service_enabled"></a>`service_enabled`

Data type: `Boolean`



Default value: `$r10k::params::webhook_service_enabled`
Default value: `true`

##### <a name="-r10k--webhook--config_ensure"></a>`config_ensure`

Expand Down Expand Up @@ -634,12 +643,12 @@ Default value:

```puppet
{
enabled => $r10k::params::webhook_chatops_enabled,
service => $r10k::params::webhook_chatops_service,
channel => $r10k::params::webhook_chatops_channel,
user => $r10k::params::webhook_chatops_user,
auth_token => $r10k::params::webhook_chatops_token,
server_uri => $r10k::params::webhook_chatops_uri,
enabled => false,
service => undef,
channel => undef,
user => undef,
auth_token => undef,
server_uri => undef,
}
```

Expand All @@ -653,9 +662,9 @@ Default value:

```puppet
{
enabled => $r10k::params::webhook_tls_enabled,
certificate => $r10k::params::webhook_tls_cert_path,
key => $r10k::params::webhook_tls_key_path,
enabled => false,
certificate => undef,
key => undef,
}
```

Expand All @@ -669,10 +678,10 @@ Default value:

```puppet
{
protected => $r10k::params::webhook_protected,
user => $r10k::params::webhook_user,
password => $r10k::params::webhook_password,
port => $r10k::params::webhook_port,
protected => true,
user => 'puppet',
password => 'puppet',
port => 4000,
tls => $tls,
}
```
Expand All @@ -687,14 +696,14 @@ Default value:

```puppet
{
command_path => $r10k::params::webhook_r10k_command_path,
config_path => $r10k::params::webhook_r10k_config_path,
default_branch => $r10k::params::webhook_r10k_default_branch,
prefix => $r10k::params::webhook_r10k_branch_prefix,
allow_uppercase => $r10k::params::webhook_r10k_allow_uppercase,
verbose => $r10k::params::webhook_r10k_verbose,
deploy_modules => $r10k::params::webhook_r10k_deploy_modules,
generate_types => $r10k::params::webhook_r10k_generate_types,
command_path => '/opt/puppetlabs/puppet/bin/r10k',
config_path => '/etc/puppetlabs/r10k/r10k.yaml',
default_branch => 'production',
prefix => undef,
allow_uppercase => false,
verbose => true,
deploy_modules => true,
generate_types => true,
}
```

Expand Down
27 changes: 0 additions & 27 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -60,31 +60,4 @@
$is_pe_server = false
$modulepath = "${r10k_basedir}/\$environment/modules"
}

# Webhook Go parameters
$webhook_ensure = false
$webhook_protected = true
$webhook_version = '2.1.0'
$webhook_user = 'puppet'
$webhook_password = 'puppet'
$webhook_port = 4000
$webhook_tls_enabled = false
$webhook_tls_cert_path = undef
$webhook_tls_key_path = undef
$webhook_chatops_enabled = false
$webhook_chatops_service = ''
$webhook_chatops_channel = ''
$webhook_chatops_user = ''
$webhook_chatops_token = ''
$webhook_chatops_uri = ''
$webhook_r10k_command_path = "/opt/puppetlabs/puppet/bin/${r10k_binary}"
$webhook_r10k_config_path = '/etc/puppetlabs/r10k/r10k.yaml'
$webhook_r10k_default_branch = 'production'
$webhook_r10k_branch_prefix = ''
$webhook_r10k_allow_uppercase = false
$webhook_r10k_verbose = true
$webhook_r10k_deploy_modules = true
$webhook_r10k_generate_types = true
$webhook_service_ensure = 'running'
$webhook_service_enabled = true
}
55 changes: 29 additions & 26 deletions manifests/webhook.pp
Original file line number Diff line number Diff line change
@@ -1,45 +1,48 @@
# Class: r10k::webhook
#
# @summary install and configure the webhook-go package as local webhook receiver to trigger r10k runs
#
# @param install_method how the package should be installed
#
class r10k::webhook (
Boolean $ensure = $r10k::params::webhook_ensure,
String $version = $r10k::params::webhook_version,
Enum['package', 'repo', 'none'] $install_method = 'package',
Boolean $ensure = false,
String $version = '2.2.0',
Variant[
Enum['running', 'stopped'],
Boolean
] $service_ensure = $r10k::params::webhook_service_ensure,
Boolean $service_enabled = $r10k::params::webhook_service_enabled,
] $service_ensure = 'running',
Boolean $service_enabled = true,
String $config_ensure = 'file',
String $config_path = '/etc/voxpupuli/webhook.yml',
R10k::Webhook::Config::ChatOps $chatops = {
enabled => $r10k::params::webhook_chatops_enabled,
service => $r10k::params::webhook_chatops_service,
channel => $r10k::params::webhook_chatops_channel,
user => $r10k::params::webhook_chatops_user,
auth_token => $r10k::params::webhook_chatops_token,
server_uri => $r10k::params::webhook_chatops_uri,
enabled => false,
service => undef,
channel => undef,
user => undef,
auth_token => undef,
server_uri => undef,
},
R10k::Webhook::Config::Server::Tls $tls = {
enabled => $r10k::params::webhook_tls_enabled,
certificate => $r10k::params::webhook_tls_cert_path,
key => $r10k::params::webhook_tls_key_path,
enabled => false,
certificate => undef,
key => undef,
},
R10k::Webhook::Config::Server $server = {
protected => $r10k::params::webhook_protected,
user => $r10k::params::webhook_user,
password => $r10k::params::webhook_password,
port => $r10k::params::webhook_port,
protected => true,
user => 'puppet',
password => 'puppet',
port => 4000,
tls => $tls,
},
R10k::Webhook::Config::R10k $r10k = {
command_path => $r10k::params::webhook_r10k_command_path,
config_path => $r10k::params::webhook_r10k_config_path,
default_branch => $r10k::params::webhook_r10k_default_branch,
prefix => $r10k::params::webhook_r10k_branch_prefix,
allow_uppercase => $r10k::params::webhook_r10k_allow_uppercase,
verbose => $r10k::params::webhook_r10k_verbose,
deploy_modules => $r10k::params::webhook_r10k_deploy_modules,
generate_types => $r10k::params::webhook_r10k_generate_types,
command_path => '/opt/puppetlabs/puppet/bin/r10k',
config_path => '/etc/puppetlabs/r10k/r10k.yaml',
default_branch => 'production',
prefix => undef,
allow_uppercase => false,
verbose => true,
deploy_modules => true,
generate_types => true,
},
R10k::Webhook::Config $config = {
server => $server,
Expand Down
2 changes: 1 addition & 1 deletion manifests/webhook/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
file { 'webhook.yml':
ensure => $r10k::webhook::config_ensure,
path => $r10k::webhook::config_path,
content => to_yaml($r10k::webhook::config),
content => stdlib::to_yaml($r10k::webhook::config),
notify => Service['webhook-go'],
}
}
Loading