From b63f9861c3a253e5071c6b15790dd6cee54a375b Mon Sep 17 00:00:00 2001 From: William Yardley Date: Wed, 12 Apr 2017 22:55:41 -0700 Subject: [PATCH] Treat Oracle "RedHat" the same as CentOS / RHEL for whether to manage repo by default. --- manifests/params.pp | 2 +- spec/classes/nginx_spec.rb | 13 ++----------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index e66da1e0e..199867b58 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -49,7 +49,7 @@ } } 'RedHat': { - if ($::operatingsystem in ['RedHat', 'CentOS'] and $::operatingsystemmajrelease in ['5', '6', '7']) { + if ($::operatingsystem in ['RedHat', 'CentOS', 'Oracle'] and $::operatingsystemmajrelease in ['6', '7']) { $_module_os_overrides = { 'manage_repo' => true, 'log_group' => 'nginx', diff --git a/spec/classes/nginx_spec.rb b/spec/classes/nginx_spec.rb index a7c48a30a..dad1ca1d9 100644 --- a/spec/classes/nginx_spec.rb +++ b/spec/classes/nginx_spec.rb @@ -109,19 +109,10 @@ it { is_expected.not_to contain_yumrepo('nginx-release') } end - context 'operatingsystemmajrelease = 5' do - let(:facts) { { operatingsystem: operatingsystem, osfamily: 'RedHat', operatingsystemmajrelease: '5' } } - it { is_expected.to contain_package('nginx') } - it do - is_expected.to contain_yumrepo('nginx-release').with( - 'baseurl' => "http://nginx.org/packages/#{operatingsystem == 'CentOS' ? 'centos' : 'rhel'}/5/$basearch/" - ) - end - end - context 'RedHat / CentOS 5 with package_source => passenger' do let(:facts) { { operatingsystem: operatingsystem, osfamily: 'RedHat', operatingsystemmajrelease: '5' } } - let(:params) { { package_source: 'passenger' } } + + let(:params) { { package_source: 'passenger', manage_repo: true } } it 'we fail' do expect { catalogue }.to raise_error(Puppet::Error, %r{is unsupported with \$package_source}) end