Skip to content

Commit

Permalink
Merge pull request #177 from tampakrap/webhook_user_group_params
Browse files Browse the repository at this point in the history
Move the $webhook::{user,group} definition to params.pp
  • Loading branch information
acidprime committed May 24, 2015
2 parents 39fde0f + acdb948 commit 0da3288
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
10 changes: 8 additions & 2 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -72,13 +70,21 @@
$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'

# 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'
Expand Down
15 changes: 8 additions & 7 deletions manifests/webhook.pp
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# 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,
$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 {
Expand All @@ -29,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'],
}
Expand Down

0 comments on commit 0da3288

Please sign in to comment.