Skip to content

Commit ca461e7

Browse files
jcpunkghoneycutt
authored andcommitted
EPEL only makes sense on RH systems but not Fedora (voxpupuli#297)
* EPEL only makes sense on RH systems but not Fedora * Updated documentation, added test * updated tests: is RHEL has EPEL, is Fedora no EPEL, is RPM based but not RHEL, is Debian
1 parent 768af7f commit ca461e7

3 files changed

Lines changed: 52 additions & 2 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Installs and manages python, python-pip, python-dev, python-virtualenv and Gunic
6666

6767
**manage_gunicorn** - Allow Installation / Removal of Gunicorn. Default: true
6868

69-
**use_epel** - Boolean to determine if the epel class is used. Default: true
69+
**use_epel** - Boolean to determine if the epel class is used. Default: true on RHEL like systems, false otherwise
7070

7171
```puppet
7272
class { 'python' :

manifests/params.pp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,16 @@
1717
'Suse' => [],
1818
'Gentoo' => ['2.7', '3.3', '3.4', '3.5']
1919
}
20-
$use_epel = true
20+
21+
if $::osfamily == 'RedHat' {
22+
if $::operatingsystem != 'Fedora' {
23+
$use_epel = true
24+
} else {
25+
$use_epel = false
26+
}
27+
} else {
28+
$use_epel = false
29+
}
2130

2231
$gunicorn_package_name = $::osfamily ? {
2332
'RedHat' => 'python-gunicorn',

spec/classes/python_spec.rb

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,37 @@
9090
it { is_expected.to contain_package("python-dev").with_ensure('absent') }
9191
end
9292
end
93+
94+
describe "EPEL does not exist for Debian" do
95+
context "default/empty" do
96+
it { should_not contain_class('epel') }
97+
end
98+
end
99+
100+
end
101+
102+
context "on a Fedora 22 OS" do
103+
let :facts do
104+
{
105+
:id => 'root',
106+
:kernel => 'Linux',
107+
:osfamily => 'RedHat',
108+
:operatingsystem => 'Fedora',
109+
:operatingsystemrelease => '22',
110+
:concat_basedir => '/dne',
111+
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
112+
}
113+
end
114+
115+
describe "EPEL does not exist for Fedora" do
116+
context "default/empty" do
117+
it { should_not contain_class('epel') }
118+
end
119+
end
120+
93121
end
94122

123+
95124
context "on a Redhat 5 OS" do
96125
let :facts do
97126
{
@@ -112,6 +141,12 @@
112141
# Basic python packages (from pip)
113142
it { is_expected.to contain_package("virtualenv")}
114143

144+
describe "EPEL may be needed on EL" do
145+
context "default/empty" do
146+
it { should contain_class('epel') }
147+
end
148+
end
149+
115150
describe "with python::dev" do
116151
context "true" do
117152
let (:params) {{ :dev => 'present' }}
@@ -271,6 +306,12 @@
271306
it { is_expected.to contain_package("python-dev").with_ensure('absent') }
272307
end
273308
end
309+
310+
describe "EPEL does not exist on Suse" do
311+
context "default/empty" do
312+
it { should_not contain_class('epel') }
313+
end
314+
end
274315
end
275316

276317
context "on a Gentoo OS" do

0 commit comments

Comments
 (0)