From 5ffe6d775a39b1fd76105a9c41b983070ae69012 Mon Sep 17 00:00:00 2001 From: nilsver Date: Wed, 16 Oct 2024 11:33:28 +0100 Subject: [PATCH] add firewall cookbook --- resources/attributes/default.rb | 2 ++ resources/metadata.rb | 1 + resources/recipes/configure.rb | 8 ++++++++ 3 files changed, 11 insertions(+) diff --git a/resources/attributes/default.rb b/resources/attributes/default.rb index d323e01..5d86ba8 100644 --- a/resources/attributes/default.rb +++ b/resources/attributes/default.rb @@ -59,6 +59,7 @@ default['redborder']['services']['redborder-exporter'] = true default['redborder']['services']['clamav'] = true default['redborder']['services']['chrony'] = true +default['redborder']['services']['firewall'] = true default['redborder']['systemdservices']['chef-client'] = ['chef-client'] default['redborder']['systemdservices']['kafka'] = ['kafka'] @@ -77,3 +78,4 @@ default['redborder']['systemdservices']['k2http'] = ['k2http'] default['redborder']['systemdservices']['redborder-exporter'] = ['rb-exporter'] default['redborder']['systemdservices']['chrony'] = ['chronyd'] +default['redborder']['systemdservices']['firewall'] = ['firewalld'] diff --git a/resources/metadata.rb b/resources/metadata.rb index 4bee5cf..2875409 100644 --- a/resources/metadata.rb +++ b/resources/metadata.rb @@ -26,3 +26,4 @@ depends 'rbcgroup' depends 'rb-clamav' depends 'rb-chrony' +depends 'rb-firewall' diff --git a/resources/recipes/configure.rb b/resources/recipes/configure.rb index 444bbae..8972aad 100644 --- a/resources/recipes/configure.rb +++ b/resources/recipes/configure.rb @@ -26,6 +26,14 @@ end end +rb_firewall_config 'Configure Firewall' do + if proxy_services['firewall'] + action :add + else + action :remove + end +end + zookeeper_config 'Configure Zookeeper' do port node['zookeeper']['port'] memory node['redborder']['memory_services']['zookeeper']['memory']