Skip to content

Commit 694c3cd

Browse files
authored
Merge pull request puppetlabs#247 from branan/puppet5_yum_support
(MODULES-5633) Add support for Puppet 5 on Redhat osfamily
2 parents 0032c15 + e209697 commit 694c3cd

File tree

2 files changed

+29
-4
lines changed

2 files changed

+29
-4
lines changed

manifests/osfamily/redhat.pp

+14-4
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,14 @@
33
) {
44
assert_private()
55

6+
$pa_collection = getvar('::puppet_agent::collection')
7+
68
if $::operatingsystem == 'Fedora' {
7-
$urlbit = 'fedora/f$releasever'
9+
if $pa_collection == 'PC1' {
10+
$urlbit = 'fedora/f$releasever'
11+
} else {
12+
$urlbit = 'fedora/$releasever'
13+
}
814
}
915
elsif $::operatingsystem == 'Amazon' {
1016
$urlbit = 'el/6'
@@ -13,8 +19,6 @@
1319
$urlbit = 'el/$releasever'
1420
}
1521

16-
$pa_collection = getvar('::puppet_agent::collection')
17-
1822
if getvar('::puppet_agent::is_pe') == true {
1923
# In Puppet Enterprise, agent packages are served by the same server
2024
# as the master, which can be using either a self signed CA, or an external CA.
@@ -42,8 +46,14 @@
4246
$_sslcacert_path = undef
4347
$_sslclientcert_path = undef
4448
$_sslclientkey_path = undef
49+
50+
if $pa_collection == 'PC1' {
51+
$_default_source = "http://yum.puppetlabs.com/${urlbit}/${pa_collection}/${::architecture}"
52+
} else {
53+
$_default_source = "http://yum.puppetlabs.com/${pa_collection}/${urlbit}/${::architecture}"
54+
}
4555
$source = getvar('::puppet_agent::source') ? {
46-
undef => "http://yum.puppetlabs.com/${urlbit}/${pa_collection}/${::architecture}",
56+
undef => $_default_source,
4757
default => getvar('::puppet_agent::source'),
4858
}
4959
}

spec/classes/puppet_agent_osfamily_redhat_spec.rb

+15
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,21 @@
8989
it { is_expected.to contain_class("puppet_agent::osfamily::redhat") }
9090
end
9191

92+
context 'when installing a puppet5 project' do
93+
let(:params) {
94+
{
95+
:package_version => '5.2.0',
96+
:collection => 'puppet5'
97+
}
98+
}
99+
it { is_expected.to contain_yumrepo('pc_repo').with({
100+
# We no longer expect the 'f' in fedora repos
101+
'baseurl' => "http://yum.puppetlabs.com/puppet5/#{urlbit.gsub('/f','/')}/x64",
102+
'enabled' => 'true',
103+
'gpgcheck' => '1',
104+
'gpgkey' => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puppetlabs\n file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puppet",
105+
}) }
106+
end
92107
end
93108
end
94109

0 commit comments

Comments
 (0)