Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install netbase for /etc/services on Ubuntu 20.04 #269

Merged
merged 12 commits into from
Feb 6, 2025
7 changes: 7 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,13 @@
ensure => installed,
}

# /etc/services file is needed, on newer OSes this is a dependency on nftables
if $facts['os']['name'] == 'Ubuntu' and $facts['os']['release']['major'] == '20.04' {
package { 'netbase':
bastelfreak marked this conversation as resolved.
Show resolved Hide resolved
ensure => present,
}
}

if $clobber_default_config {
file { $configuration_path:
ensure => file,
Expand Down
7 changes: 7 additions & 0 deletions spec/classes/nftables_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@

it { is_expected.to contain_package('nftables') }

case [os_facts[:os]['name'], os_facts[:os]['release']['major']]
when ['Ubuntu', '20.04']
it { is_expected.to contain_package('netbase') }
else
it { is_expected.not_to contain_package('netbase') }
end

context 'with clobber_default_config false' do
let(:params) do
{ clobber_default_config: false }
Expand Down
Loading