Showing with 45 additions and 7 deletions.
  1. +1 −1 .fixtures.yml
  2. +4 −0 CHANGELOG
  3. +2 −2 Modulefile
  4. +26 −0 files/config_version.sh
  5. +6 −0 lib/facter/r10k_environment.rb
  6. +1 −1 manifests/params.pp
  7. +5 −3 manifests/webhook.pp
2 changes: 1 addition & 1 deletion .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ fixtures:
ruby: "git://github.com/puppetlabs/puppetlabs-ruby.git"
gcc: "git://github.com/puppetlabs/puppetlabs-gcc.git"
pe_gem: "git://github.com/puppetlabs/puppetlabs-pe_gem.git"
make: "git://github.com/Element84/puppet-make.git"
make: "git://github.com/cmroddy/puppet-make.git"
inifile: "git://github.com/puppetlabs/puppetlabs-inifile.git"
vcsrepo: "git://github.com/puppetlabs/puppetlabs-vcsrepo.git"
git: "git://github.com/puppetlabs/puppetlabs-git.git"
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2.5.2 - Chris Roddy
* Fixed missing make dep, will be removed in 3.x release of module
2.5.1 - Zack Smith
* README updates
2.5.0 - Zack Smith & Sean Keery
* Puppet Enterprise 3.7 compatibility
* Fixed bugs #108,#110,#110,#111
Expand Down
4 changes: 2 additions & 2 deletions Modulefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name 'zack-r10k'
version '2.5.0'
version '2.5.2'
source 'https://github.com/acidprime/r10k'
author 'zack'
license 'Apache License, Version 2.0'
Expand All @@ -12,7 +12,7 @@ dependency 'puppetlabs/stdlib', '>= 3.2.0'
dependency 'puppetlabs/ruby', '>= 0.0.2'
dependency 'puppetlabs/gcc', '>= 0.0.3'
dependency 'puppetlabs/pe_gem', '>= 0.0.1'
dependency 'mhuffnagle/make', '>= 0.0.1'
dependency 'croddy/make', '>= 0.0.3'
dependency 'puppetlabs/inifile', '>= 1.0.0'
dependency 'puppetlabs/vcsrepo', '>= 0.1.2'
dependency 'puppetlabs/git', '>= 0.0.3'
Expand Down
26 changes: 26 additions & 0 deletions files/config_version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
# Create a environment.conf in your control repo
# and set the path to this script i.e.
# config_version = scripts/config_version.sh $environment
# https://docs.puppetlabs.com/puppet/latest/reference/config_file_environment.html#configversion
# Don't forget to restart pe-puppetserver/pe-httpd to pickup on the new config_version
# Return the latest commit with the GitHub URL for it
# The repos are placed using r10k

# Get the hash of the latest commit
sha=$(git --git-dir \
/etc/puppetlabs/puppet/environments/$1/.git rev-parse HEAD)

message=$(git --git-dir \
/etc/puppetlabs/puppet/environments/$1/.git log -1 --pretty='%s')

# Get the address for remote origin
remote=$(git --git-dir \
/etc/puppetlabs/puppet/environments/$1/.git config --get remote.origin.url)

# Sanitize the git remote to be an http url.
#url=$(echo "${remote}"|/bin/sed -e 's/git@//g; s/:/\//g; s/.git$//g')
url=$(echo "${remote}"| awk -F'[@:]' '{ sub(/.git$/,"");print "http://"$2"/"$3}')

# Return a full URL for it
echo "[${message}](${url}/tree/${sha})"
6 changes: 6 additions & 0 deletions lib/facter/r10k_environment.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
require 'puppet'
Facter.add('r10k_environment') do
setcode do
Puppet[:environment].to_s
end
end
2 changes: 1 addition & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
$version = '1.4.0'
$manage_modulepath = false
$manage_ruby_dependency = 'declare'
$install_options = undef
$install_options = []
$sources = undef

# r10k configuration
Expand Down
8 changes: 5 additions & 3 deletions manifests/webhook.pp
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,11 @@
hasstatus => false,
}

package { 'sinatra':
ensure => installed,
provider => 'pe_gem',
if !defined(Package['sinatra']) {
package { 'sinatra':
ensure => installed,
provider => 'pe_gem',
}
}

if versioncmp($::pe_version, '3.7.0') > 0 {
Expand Down