diff --git a/manifests/params.pp b/manifests/params.pp index 5850d49..02d68d8 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -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' diff --git a/spec/classes/epel_spec.rb b/spec/classes/epel_spec.rb index fbcea9c..d8cfe6b 100644 --- a/spec/classes/epel_spec.rb +++ b/spec/classes/epel_spec.rb @@ -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