package: install "nginx" package when OS isn't recognized

This will provide broader OS compatibility without having to manually add
support for specific OSes.
This commit is contained in:
Matthew Haughton 2014-12-07 20:55:41 -05:00
parent 3cec62042e
commit 4eea8c7397
2 changed files with 3 additions and 5 deletions

View file

@ -90,10 +90,8 @@ class nginx::package(
} }
} }
default: { default: {
case $::operatingsystem { package { 'nginx':
default: { ensure => $package_ensure,
fail("Module ${module_name} is not supported on ${::operatingsystem}")
}
} }
} }
} }

View file

@ -111,6 +111,6 @@ describe 'nginx::package' do
context 'other' do context 'other' do
let(:facts) {{ :operatingsystem => 'xxx', :osfamily => 'linux' }} let(:facts) {{ :operatingsystem => 'xxx', :osfamily => 'linux' }}
it { expect { subject }.to raise_error(Puppet::Error, /Module nginx is not supported on xxx/) } it { is_expected.to contain_package('nginx') }
end end
end end