Skip to content

Commit

Permalink
check for Amazon Linux version 2
Browse files Browse the repository at this point in the history
  • Loading branch information
nehalrp committed Jan 16, 2020
1 parent 810e597 commit 538acd2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# the most specific declaration of proxy.
$proxy = 'absent'

if "${::operatingsystem}" == 'Amazon' {
if "${::operatingsystem}" == 'Amazon' and "${::operatingsystemmajrelease}" == '2' {
# Amazon Linux 2 is equivalent of Enterprise Linux 7 so we use that version for epel
# https://aws.amazon.com/premiumsupport/knowledge-center/ec2-enable-epel/
$os_maj_release = '7'
Expand Down
5 changes: 3 additions & 2 deletions spec/classes/epel_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,9 @@
context 'operatingsystem => Amazon' do
let :facts do
default_facts.merge(
operatingsystem: 'Amazon',
operatingsystemrelease: 'Amazon'
operatingsystem: 'Amazon',
operatingsystemrelease: 'Amazon',
operatingsystemmajrelease: '2'
)
end

Expand Down

0 comments on commit 538acd2

Please sign in to comment.