Skip to content

Commit

Permalink
Merge pull request #476 from mihaibuzgau/master
Browse files Browse the repository at this point in the history
(MODULES-10110) Handle Amazon Linux 2 as el-7
  • Loading branch information
Gheorghe Popescu authored Mar 20, 2020
2 parents 444ca84 + 1dd4eb0 commit 9361e94
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions manifests/osfamily/redhat.pp
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,22 @@
$platform_and_version = "fedora/${::operatingsystemmajrelease}"
}
'Amazon': {
$platform_and_version = 'el/6'
if ("${::operatingsystemmajrelease}" == '2') {
$amz_el_version = '7'
} else {
$amz_el_version = '6'
}
$platform_and_version = "el/${amz_el_version}"
}
default: {
$platform_and_version = "el/${::operatingsystemmajrelease}"
}
}
if ($::puppet_agent::is_pe and (!$::puppet_agent::use_alternate_sources)) {
$pe_server_version = pe_build_version()
# Treat Amazon Linux just like Enterprise Linux 6
# Treat Amazon Linux just like Enterprise Linux
$pe_repo_dir = ($::operatingsystem == 'Amazon') ? {
true => "el-6-${::architecture}",
true => "el-${amz_el_version}-${::architecture}",
default => $::platform_tag,
}
if $::puppet_agent::source {
Expand Down
2 changes: 1 addition & 1 deletion spec/classes/puppet_agent_osfamily_redhat_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
}
end

[['Fedora', 'fedora/f31', 31], ['CentOS', 'el/7', 7], ['Amazon', 'el/6', 6]].each do |os, urlbit, osmajor|
[['Fedora', 'fedora/f31', 31], ['CentOS', 'el/7', 7], ['Amazon', 'el/6', 2017], ['Amazon', 'el/7', 2]].each do |os, urlbit, osmajor|
context "with #{os} and #{urlbit}" do
let(:facts) do
super().merge(:operatingsystem => os, :operatingsystemmajrelease => osmajor)
Expand Down

0 comments on commit 9361e94

Please sign in to comment.