Skip to content

Commit

Permalink
add basic scaffold for webhook-go
Browse files Browse the repository at this point in the history
  • Loading branch information
dhollinger committed May 9, 2023
1 parent 17c8413 commit cb9b97a
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 0 deletions.
10 changes: 10 additions & 0 deletions manifests/webhook.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Class: r10k::webhook
#
#
class r10k::webhook (
Boolean $ensure = true,
String $user = $r10k::params::webhook_user,
String $password = $r10k::params::webhook_password,
) {
# resources
}
8 changes: 8 additions & 0 deletions manifests/webhook/config.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Class: r10k::webhook::config
#
#
class r10k::webhook::config (
R10k::Webhook::Config $config
) {
# resources
}
26 changes: 26 additions & 0 deletions manifests/webhook/package.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Class: r10k::webhook::package
#
#
class r10k::webhook::package (
String $version = '2.0.1',
) {
case $facts['os']['name'] {
'RedHat', 'CentOS': {
$provider = 'rpm'
$package_url = "https://github.com/voxpupuli/webhook-go/releases/download/v${version}/webhook-go_${version}_linux_amd64.rpm"
}
'Debian', 'Ubuntu': {
$provider = 'dpkg'
$package_url = "https://github.com/voxpupuli/webhook-go/releases/download/v${version}/webhook-go_${version}_linux_amd64.deb"
}
default: {
fail("Operating system ${facts['os']['name']} not supported for packages")
}
}

package { 'webhook-go':
ensure => 'present',
source => $package_url,
proviser => $provider,
}
}
8 changes: 8 additions & 0 deletions manifests/webhook/service.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Class: r10k::webhook::service
#
#
class r10k::webhook::service {
service { 'webhook':
ensure => 'running',
}
}

0 comments on commit cb9b97a

Please sign in to comment.