From 9cdfcfdc397410dc1fe48641ace5fcf47e123085 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Wed, 11 Jul 2018 10:43:41 +0200 Subject: add official ubuntu support --- metadata.json | 8 ++++++++ spec/classes/ferm_spec.rb | 9 ++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index 5eb2532..00f8141 100644 --- a/metadata.json +++ b/metadata.json @@ -47,6 +47,14 @@ "11" ] }, + { + "operatingsystem": "Ubuntu", + "operatingsystemrelease": [ + "14.04", + "16.04", + "18.04" + ] + }, { "operatingsystem": "Fedora", "operatingsystemrelease": [ diff --git a/spec/classes/ferm_spec.rb b/spec/classes/ferm_spec.rb index e039c14..dbf9cbd 100644 --- a/spec/classes/ferm_spec.rb +++ b/spec/classes/ferm_spec.rb @@ -31,14 +31,21 @@ describe 'ferm' do it { is_expected.to compile.with_all_deps } it { is_expected.to contain_service('ferm') } + if facts[:os]['name'] == "Ubuntu" + it { is_expected.to contain_file_line('enable_ferm') } + end end context 'with managed configfile' do let :params do { manage_configfile: true } end + if facts[:os]['name'] == 'Ubuntu' + it { is_expected.to contain_concat('/etc/ferm/ferm.conf') } + else + it { is_expected.to contain_concat('/etc/ferm.conf') } + end it { is_expected.to compile.with_all_deps } - it { is_expected.to contain_concat('/etc/ferm.conf') } it { is_expected.to contain_concat__fragment('ferm_header.conf') } it { is_expected.to contain_concat__fragment('ferm.conf') } end -- cgit v1.2.3 From 40dc371f62396d5d11ccbc56b2e4e63e06cda5a5 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Wed, 11 Jul 2018 10:46:23 +0200 Subject: disable rule caching on ubuntu Fixes #16. Ubuntu caches rules. This doesn't allow us to reload the daemon and to apply new rules. Also this is a ubuntu only feature, it works well on all other platforms without cache. --- manifests/service.pp | 5 +++++ spec/classes/ferm_spec.rb | 1 + 2 files changed, 6 insertions(+) diff --git a/manifests/service.pp b/manifests/service.pp index ddc6129..f19997f 100644 --- a/manifests/service.pp +++ b/manifests/service.pp @@ -18,6 +18,11 @@ class ferm::service { line => 'ENABLED="yes"', match => 'ENABLED=', } + file_line{'disable_ferm_cache': + path => '/etc/default/ferm', + line => 'CACHE="no"', + match => 'CACHE=', + } } } } diff --git a/spec/classes/ferm_spec.rb b/spec/classes/ferm_spec.rb index dbf9cbd..0312adc 100644 --- a/spec/classes/ferm_spec.rb +++ b/spec/classes/ferm_spec.rb @@ -33,6 +33,7 @@ describe 'ferm' do it { is_expected.to contain_service('ferm') } if facts[:os]['name'] == "Ubuntu" it { is_expected.to contain_file_line('enable_ferm') } + it { is_expected.to contain_file_line('disable_ferm_cache') } end end context 'with managed configfile' do -- cgit v1.2.3 From 55963490dcfea644defad8afe87411fb22f6d798 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Wed, 11 Jul 2018 11:12:34 +0200 Subject: rubocop: autofix --- spec/classes/ferm_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/classes/ferm_spec.rb b/spec/classes/ferm_spec.rb index 0312adc..0f9f854 100644 --- a/spec/classes/ferm_spec.rb +++ b/spec/classes/ferm_spec.rb @@ -31,7 +31,7 @@ describe 'ferm' do it { is_expected.to compile.with_all_deps } it { is_expected.to contain_service('ferm') } - if facts[:os]['name'] == "Ubuntu" + if facts[:os]['name'] == 'Ubuntu' it { is_expected.to contain_file_line('enable_ferm') } it { is_expected.to contain_file_line('disable_ferm_cache') } end -- cgit v1.2.3