Showing with 45 additions and 13 deletions.
  1. +12 −0 CHANGELOG.md
  2. +3 −2 manifests/params.pp
  3. +1 −1 manifests/webhook.pp
  4. +9 −1 manifests/webhook/package.pp
  5. +1 −1 metadata.json
  6. +19 −8 spec/classes/webhook_spec.rb
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ 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.

## [v11.0.1](https://github.com/voxpupuli/puppet-r10k/tree/v11.0.1) (2023-06-08)

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

**Merged pull requests:**

- update webhook code with some basic fixes [\#603](https://github.com/voxpupuli/puppet-r10k/pull/603) ([dhollinger](https://github.com/dhollinger))

## [v11.0.0](https://github.com/voxpupuli/puppet-r10k/tree/v11.0.0) (2023-06-05)

[Full Changelog](https://github.com/voxpupuli/puppet-r10k/compare/v10.3.0...v11.0.0)
Expand All @@ -17,7 +25,11 @@ These should not affect the functionality of the module.

**Merged pull requests:**

- puppetlabs/vcsrepo: Allow 6.x [\#602](https://github.com/voxpupuli/puppet-r10k/pull/602) ([bastelfreak](https://github.com/bastelfreak))
- puppet/systemd: Allow 5.x [\#601](https://github.com/voxpupuli/puppet-r10k/pull/601) ([bastelfreak](https://github.com/bastelfreak))
- puppetlabs/inifile: Allow 6.x [\#600](https://github.com/voxpupuli/puppet-r10k/pull/600) ([bastelfreak](https://github.com/bastelfreak))
- puppetlabs/stdlib: Allow 9.x [\#599](https://github.com/voxpupuli/puppet-r10k/pull/599) ([bastelfreak](https://github.com/bastelfreak))
- Release 11.0.0 [\#598](https://github.com/voxpupuli/puppet-r10k/pull/598) ([dhollinger](https://github.com/dhollinger))
- README: Don't use top level facts in examples [\#596](https://github.com/voxpupuli/puppet-r10k/pull/596) ([Geod24](https://github.com/Geod24))
- Change README.md dependency on \(abandoned\) abrader/gms to bjvrielink/gms [\#593](https://github.com/voxpupuli/puppet-r10k/pull/593) ([bschonec](https://github.com/bschonec))
- update module to work with webhook-go [\#590](https://github.com/voxpupuli/puppet-r10k/pull/590) ([dhollinger](https://github.com/dhollinger))
Expand Down
5 changes: 3 additions & 2 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,15 @@
}

# 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 = ''
$webhook_tls_key = ''
$webhook_tls_cert_path = undef
$webhook_tls_key_path = undef
$webhook_chatops_enabled = false
$webhook_chatops_service = ''
$webhook_chatops_channel = ''
Expand Down
2 changes: 1 addition & 1 deletion manifests/webhook.pp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
chatops => $chatops,
r10k => $r10k,
},
) {
) inherits r10k::params {
contain r10k::webhook::package
contain r10k::webhook::config
contain r10k::webhook::service
Expand Down
10 changes: 9 additions & 1 deletion manifests/webhook/package.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,28 @@
case $facts['os']['family'] {
'RedHat': {
$provider = 'rpm'
$pkg_file = '/tmp/webhook-go.rpm'
$package_url = "https://github.com/voxpupuli/webhook-go/releases/download/v${r10k::webhook::version}/webhook-go_${r10k::webhook::version}_linux_amd64.rpm"
}
'Debian', 'Ubuntu': {
$provider = 'dpkg'
$pkg_file = '/tmp/webhook-go.deb'
$package_url = "https://github.com/voxpupuli/webhook-go/releases/download/v${r10k::webhook::version}/webhook-go_${r10k::webhook::version}_linux_amd64.deb"
}
default: {
fail("Operating system ${facts['os']['name']} not supported for packages")
}
}

file { $pkg_file:
ensure => file,
source => $package_url,
before => Package['webhook-go'],
}

package { 'webhook-go':
ensure => 'present',
source => $package_url,
source => $pkg_file,
provider => $provider,
}
}
2 changes: 1 addition & 1 deletion 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": "11.0.0",
"version": "11.0.1",
"operatingsystem_support": [
{
"operatingsystem": "RedHat",
Expand Down
27 changes: 19 additions & 8 deletions spec/classes/webhook_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,23 @@
config_ensure: 'file',
config_path: '/etc/voxpupuli/webhook.yml',
chatops: {
enabled: false,
},
tls: {
enabled: false,
enabled: true,
service: 'slack',
channel: '#channel',
user: 'root',
auth_token: 'ABCDEF123456789',
server_uri: 'https://webhook.slack.com/endpoint',
},
server: {
protected: true,
user: 'puppet',
password: 'puppet',
port: 4000,
tls: {
enabled: false,
}
enabled: true,
certificate: '/path/to/cert',
key: '/path/to/key',
},
},
r10k: {
command_path: '/opt/puppetlabs/puppet/bin/r10k',
Expand All @@ -51,9 +55,16 @@
password: puppet
port: 4000
tls:
enabled: false
enabled: true
certificate: "/path/to/cert"
key: "/path/to/key"
chatops:
enabled: false
enabled: true
service: slack
channel: "#channel"
user: root
auth_token: ABCDEF123456789
server_uri: https://webhook.slack.com/endpoint
r10k:
command_path: "/opt/puppetlabs/puppet/bin/r10k"
config_path: "/etc/puppetlabs/r10k/r10k.yaml"
Expand Down