Showing with 124 additions and 6 deletions.
  1. +3 −3 .travis.yml
  2. +2 −0 CHANGELOG
  3. +1 −1 Gemfile
  4. +14 −1 manifests/install.pp
  5. +1 −1 metadata.json
  6. +103 −0 spec/classes/install_spec.rb
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ branches:
language: ruby
bundler_args: --without development
script:
- "rake lint"
- "rake syntax"
- "rake spec SPEC_OPTS='--format documentation'"
- "bundle exec rake lint"
- "bundle exec rake syntax"
- "bundle exec rake spec SPEC_OPTS='--format documentation'"
after_success:
- git clone -q git://github.com/puppetlabs/ghpublisher.git .forge-releng
- .forge-releng/publish
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
2.7.2 - Federico Voges & Ben ford
* Fix #155 gem install issues with arguments
2.7.1 - Alex Scoble & esalberg & annaken
* Fix webhook directory permissions #144
* Fix gem dep regression #154
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ end
if puppetversion = ENV['PUPPET_GEM_VERSION']
gem 'puppet', puppetversion, :require => false
else
gem 'puppet', :require => false
gem 'puppet', '3.7.0', :require => false
end

# vim:ft=ruby
15 changes: 14 additions & 1 deletion manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,26 @@
elsif $provider == 'pe_gem' {
include r10k::install::pe_gem
}


# Currently we share a package resource to keep things simple
# Puppet seems to have a bug (see #87 ) related to passing an
# empty to value to the gem,pe_gem providers. This code
# converts an empty array to semi-standard gem options
# This was previously undef but that caused strict var issues
if $provider in ['pe_gem','gem' ] and $install_options == [] {
$provider_install_options = ['--no-ri', '--no-rdoc']
} else {
$provider_install_options = $install_options
}

# Puppet Enterprise 3.8 and ships an embedded r10k so thats all thats supported
# This conditional should not effect FOSS customers based on the fact
unless versioncmp($::pe_version, '3.8.0') >= 0 {
package { $real_package_name:
ensure => $version,
provider => $provider,
install_options => $install_options,
install_options => $provider_install_options
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"source": "https://github.com/acidprime/r10k",
"summary": "Module for setting up dynamic environments using r10k",
"tags": ["git", "pe", "environment", "mcollective"],
"version": "2.7.1",
"version": "2.7.2",
"operatingsystem_support": [
{
"operatingsystem": "RedHat",
Expand Down
103 changes: 103 additions & 0 deletions spec/classes/install_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -257,4 +257,107 @@
)
}
end
context "Puppet Enterprise 3.7.x on a RedHat 5 installing via pe_gem with empty install_options" do
let :params do
{
:manage_ruby_dependency => 'BOGON',
:package_name => 'r10k',
:provider => 'pe_gem',
:version => '1.5.0',
:keywords => '',
:install_options => [],
}
end
let :facts do
{
:manage_ruby_dependency => 'BOGON',
:osfamily => 'RedHat',
:operatingsystemrelease => '5',
:operatingsystem => 'Centos',
:is_pe => '',
:pe_version => '3.7.0'
}
end
it { should contain_package("r10k").with(
:ensure => '1.5.0',
:provider => 'pe_gem',
:install_options => ['--no-ri', '--no-rdoc']
)
}
end
context "On a RedHat 5 installing via gem with empty install_options" do
let :params do
{
:manage_ruby_dependency => 'include',
:package_name => 'r10k',
:provider => 'gem',
:version => '1.5.0',
:keywords => '',
:install_options => [],
}
end
let :facts do
{
:osfamily => 'RedHat',
:operatingsystemrelease => '5',
:operatingsystem => 'Centos',
}
end
it { should contain_package("r10k").with(
:ensure => '1.5.0',
:provider => 'gem',
:install_options => ['--no-ri', '--no-rdoc']
)
}
end
context "On a RedHat 5 installing via gem with populated install_options" do
let :params do
{
:manage_ruby_dependency => 'include',
:package_name => 'r10k',
:provider => 'gem',
:version => '1.5.0',
:keywords => '',
:install_options => ['BOGON'],
}
end
let :facts do
{
:osfamily => 'RedHat',
:operatingsystemrelease => '5',
:operatingsystem => 'Centos',
}
end
it { should contain_package("r10k").with(
:ensure => '1.5.0',
:provider => 'gem',
:install_options => ['BOGON']
)
}
end
context "On a RedHat 5 installing via yum with populated install_options" do
let :params do
{
:manage_ruby_dependency => 'include',
:package_name => 'r10k',
:provider => 'yum',
:version => '1.5.0',
:keywords => '',
:install_options => ['BOGON'],
}
end
let :facts do
{
:osfamily => 'RedHat',
:operatingsystemrelease => '5',
:operatingsystem => 'Centos',
}
end
it { should contain_package("r10k").with(
:ensure => '1.5.0',
:provider => 'yum',
:install_options => ['BOGON']
)
}
end
end