Skip to content

Commit

Permalink
Changes RedHat repo to use the EPEL module
Browse files Browse the repository at this point in the history
* Yum::Install to install the RPM is a bit more flakey 
* EPEL module is pretty ubiquitous, not that big of a deal to add it
  • Loading branch information
petems committed Feb 12, 2017
1 parent 9087af7 commit 93d6f3e
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 25 deletions.
5 changes: 2 additions & 3 deletions .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ fixtures:
concat:
repo: 'git://github.com/puppetlabs/puppetlabs-concat'
ref: '2.1.0'
yum:
repo: 'https://github.com/voxpupuli/puppet-yum.git'
ref: 'v0.10.0'
epel:
repo: 'https://github.com/stahnma/puppet-module-epel'
symlinks:
'collectd': "#{source_dir}"
4 changes: 2 additions & 2 deletions manifests/plugin/cuda.pp
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
if $::osfamily == 'RedHat' {
# Epel is installed in install.pp if manage_repo is true
# python-pip doesn't exist in base for RedHat. Need epel installed first
if (defined(Yum::Install['epel-release'])) {
if (defined(Class['::epel'])) {
Package['python-pip'] {
require => Yum::Install['epel-release'],
require => Class['::epel'],
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions manifests/plugin/rabbitmq.pp
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@
if $::osfamily == 'RedHat' {
# Epel is installed in install.pp if manage_repo is true
# python-pip doesn't exist in base for RedHat. Need epel installed first
if (defined(Yum::Install['epel-release'])) {
if (defined(Class['::epel'])) {
Package['python-pip'] {
require => Yum::Install['epel-release'],
require => Class['::epel'],
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion manifests/repo.pp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
$osfamily_downcase = downcase($::osfamily)

if defined("::collectd::repo::${osfamily_downcase}") {
include "::collectd::repo::${osfamily_downcase}"
require "::collectd::repo::${osfamily_downcase}"
} else {
notify{"You have asked to manage_repo on a system that doesn't have a repo class specified: ${::osfamily}":}
}
Expand Down
13 changes: 1 addition & 12 deletions manifests/repo/redhat.pp
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,7 @@
}

} else {

# TODO: Replace this with EPEL module requirement in Major version bump

if !defined(Yum::Install['epel-release']) {
yum::install { 'epel-release':
ensure => 'present',
source => "https://dl.fedoraproject.org/pub/epel/epel-release-latest-${::operatingsystemmajrelease}.noarch.rpm",
before => Package[$::collectd::package_name],
}
}


require ::epel
}

}
4 changes: 2 additions & 2 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@
"version_requirement": ">= 1.2.5"
},
{
"name": "puppet-yum",
"version_requirement": ">= 0.9.15 < 1.0.0"
"name": "stahnma-epel",
"version_requirement": ">= 1.2.2"
},
{
"name": "puppetlabs-apt",
Expand Down
4 changes: 2 additions & 2 deletions spec/classes/collectd_init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
)
end
if facts[:osfamily] == 'RedHat'
it { is_expected.to contain_yum__install('epel-release') }
it { is_expected.to contain_class('epel') }
end
end

Expand Down Expand Up @@ -191,7 +191,7 @@
context 'and ci_package_repo empty' do
let(:params) { { manage_repo: true } }
if facts[:osfamily] == 'RedHat'
it { is_expected.to contain_yum__install('epel-release') }
it { is_expected.to contain_class('epel') }
end
end

Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
on host, puppet('module', 'install', 'puppetlabs-apt'), acceptable_exit_codes: [0]
on host, puppet('module', 'install', 'puppetlabs-stdlib'), acceptable_exit_codes: [0]
on host, puppet('module', 'install', 'puppetlabs-concat'), acceptable_exit_codes: [0]
on host, puppet('module', 'install', 'puppet-yum'), acceptable_exit_codes: [0]
on host, puppet('module', 'install', 'stahnma-epel'), acceptable_exit_codes: [0]
end
end
end

0 comments on commit 93d6f3e

Please sign in to comment.