Showing with 19 additions and 6 deletions.
  1. +3 −0 CHANGELOG
  2. +1 −1 Modulefile
  3. +4 −2 files/agent/r10k.rb
  4. +8 −1 manifests/params.pp
  5. +1 −0 manifests/webhook.pp
  6. +2 −2 templates/webhook.init.erb
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
2.5.3 - Eli Young & te206676
* Ubuntu Support for Webhook #118
* Permissions on Certificate #119
2.5.2 - Chris Roddy
* Fixed missing make dep, will be removed in 3.x release of module
2.5.1 - Zack Smith
Expand Down
2 changes: 1 addition & 1 deletion Modulefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name 'zack-r10k'
version '2.5.2'
version '2.5.3'
source 'https://github.com/acidprime/r10k'
author 'zack'
license 'Apache License, Version 2.0'
Expand Down
6 changes: 4 additions & 2 deletions files/agent/r10k.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,15 @@ def run_cmd(action,arg=nil)
output = ''
git = ['/usr/bin/env', 'git']
r10k = ['/usr/bin/env', 'r10k']
# Given most people using this are using Puppet Enterprise, add the PE Path
environment = {"LC_ALL" => "C","PATH" => "#{ENV['PATH']}:/opt/puppet/bin"}
case action
when 'push','pull','status'
cmd = git
cmd << 'push' if action == 'push'
cmd << 'pull' if action == 'pull'
cmd << 'status' if action == 'status'
reply[:status] = run(cmd, :stderr => :error, :stdout => :output, :chomp => true, :cwd => arg )
reply[:status] = run(cmd, :stderr => :error, :stdout => :output, :chomp => true, :cwd => arg, :environment => environment )
when 'cache','synchronize','sync', 'deploy', 'deploy_module'
cmd = r10k
cmd << 'cache' if action == 'cache'
Expand All @@ -56,7 +58,7 @@ def run_cmd(action,arg=nil)
elsif action == 'deploy_module'
cmd << 'deploy' << 'module' << arg
end
reply[:status] = run(cmd, :stderr => :error, :stdout => :output, :chomp => true)
reply[:status] = run(cmd, :stderr => :error, :stdout => :output, :chomp => true, :environment => environment)
end
end
end
Expand Down
9 changes: 8 additions & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,14 @@
$webhook_prefix_command = '/bin/echo example'
$webhook_enable_ssl = true
$webhook_use_mcollective = true

if $::osfamily == Debian {
$functions_path = '/lib/lsb/init-functions'
$start_pidfile_args = '--pidfile=$pidfile'
}
else {
$functions_path = '/etc/rc.d/init.d/functions'
$start_pidfile_args = '--pidfile $pidfile'
}
if $::is_pe == true or $::is_pe == 'true' {
# Puppet Enterprise specific settings
$puppetconf_path = '/etc/puppetlabs/puppet'
Expand Down
1 change: 1 addition & 0 deletions manifests/webhook.pp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
ensure => 'file',
owner => 'peadmin',
group => 'peadmin',
mode => '0644',
content => file('/etc/puppetlabs/puppet/ssl/certs/pe-internal-peadmin-mcollective-client.pem'),
}

Expand Down
4 changes: 2 additions & 2 deletions templates/webhook.init.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ DAEMON_USER='<%= @user %>'
RETVAL=0

# Source function library.
. /etc/rc.d/init.d/functions
. <%= @functions_path %>

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
export PATH

start() {
echo
echo -n $"Starting webhook: "
daemon --user ${DAEMON_USER:?} --pidfile $pidfile $webhook
daemon --user ${DAEMON_USER:?} <%= @start_pidfile_args %> $webhook
RETVAL=$?
return $RETVAL
}
Expand Down