From b0afdf4d64bc735b36ffbf1aae3ac1464bb2394b Mon Sep 17 00:00:00 2001 From: Theo Chatzimichos Date: Sun, 24 May 2015 09:09:19 +0200 Subject: [PATCH 1/2] Move the $webhook::{user,group} definition to params.pp Also, remove webhook::git_server as it seems useless --- manifests/params.pp | 10 ++++++++-- manifests/webhook.pp | 7 +++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index 862042ea..35fadd86 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -28,8 +28,6 @@ $mcollective = false # Webhook configuration information - $webhook_user = 'puppet' - $webhook_pass = 'puppet' $webhook_bind_address = '0.0.0.0' $webhook_port = '8088' $webhook_access_logfile = '/var/log/webhook/access.log' @@ -71,6 +69,10 @@ $modulepath = "${r10k_basedir}/\$environment/modules:${pe_module_path}" $provider = 'pe_gem' $r10k_binary = 'r10k' + + # webhook + $webhook_user = 'peadmin' + $webhook_pass = 'peadmin' } else { # Getting ready for FOSS support in this module $puppetconf_path = '/etc/puppet' @@ -78,6 +80,10 @@ # Mcollective configuration dynamic $modulepath = "${r10k_basedir}/\$environment/modules" + # webhook + $webhook_user = 'puppet' + $webhook_pass = 'puppet' + case $::osfamily { 'debian': { $plugins_dir = '/usr/share/mcollective/plugins/mcollective' diff --git a/manifests/webhook.pp b/manifests/webhook.pp index 92346e0e..291c26af 100644 --- a/manifests/webhook.pp +++ b/manifests/webhook.pp @@ -1,9 +1,8 @@ # This class creates a github webhoook to allow curl style post-rec scripts class r10k::webhook( - $user = 'peadmin', - $group = 'peadmin', - $git_server = 'localhost', - $webhook_bin_template = $::r10k::params::webhook_bin_template, + $user = $r10k::params::webhook_user, + $group = $r10k::params::webhook_group, + $webhook_bin_template = $r10k::params::webhook_bin_template, ) inherits r10k::params { File { From acdb9486571cd292bc5bad3d24a856a12345adff Mon Sep 17 00:00:00 2001 From: Theo Chatzimichos Date: Sun, 24 May 2015 09:27:46 +0200 Subject: [PATCH 2/2] Add also service_{template,file} in webhook class declaration Also, drop the webhook_ prefix --- manifests/webhook.pp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/manifests/webhook.pp b/manifests/webhook.pp index 291c26af..f8d28468 100644 --- a/manifests/webhook.pp +++ b/manifests/webhook.pp @@ -1,8 +1,10 @@ # This class creates a github webhoook to allow curl style post-rec scripts class r10k::webhook( - $user = $r10k::params::webhook_user, - $group = $r10k::params::webhook_group, - $webhook_bin_template = $r10k::params::webhook_bin_template, + $user = $r10k::params::webhook_user, + $group = $r10k::params::webhook_group, + $bin_template = $r10k::params::webhook_bin_template, + $service_template = $r10k::params::webhook_service_template, + $service_file = $r10k::params::webhook_service_file, ) inherits r10k::params { File { @@ -28,14 +30,14 @@ } file { 'webhook_init_script': - content => template("r10k/${::r10k::params::webhook_service_template}"), - path => $::r10k::params::webhook_service_file, + content => template("r10k/${service_template}"), + path => $service_file, require => Package['sinatra'], before => File['webhook_bin'], } file { 'webhook_bin': - content => template($webhook_bin_template), + content => template($bin_template), path => '/usr/local/bin/webhook', notify => Service['webhook'], }