}
end
- search(:node, "roles:mail") do |server|
+ search(:node, "roles:mail OR roles:prometheus") do |server|
allowed_ips = server.interfaces(:role => :internal).map do |interface|
"#{interface[:network]}/#{interface[:prefix]}"
end
package "shorewall"
+systemd_service "shorewall-docker" do
+ service "shorewall"
+ dropin "docker"
+ exec_stop "/sbin/shorewall $OPTIONS stop"
+ notifies :restart, "service[shorewall]"
+end
+
template "/etc/default/shorewall" do
source "shorewall-default.erb"
owner "root"
end
template "/etc/shorewall/rules" do
- action :nothing
source "shorewall-rules.erb"
owner "root"
group "root"
notifies :restart, "service[shorewall]"
end
-notify_group "shorewall-rules" do
- action :run
- notifies :create, "template[/etc/shorewall/rules]"
-end
-
if node[:networking][:firewall][:enabled]
service "shorewall" do
action [:enable, :start]
supports :restart => true
status_command "shorewall status"
+ ignore_failure true
end
else
service "shorewall" do
action [:disable, :stop]
supports :restart => true
status_command "shorewall status"
+ ignore_failure true
end
end
end
template "/etc/shorewall6/rules" do
- action :nothing
source "shorewall-rules.erb"
owner "root"
group "root"
notifies :restart, "service[shorewall6]"
end
- notify_group "shorewall6-rules" do
- action :run
- notifies :create, "template[/etc/shorewall6/rules]"
- end
-
if node[:networking][:firewall][:enabled]
service "shorewall6" do
action [:enable, :start]
supports :restart => true
status_command "shorewall6 status"
+ ignore_failure true
end
else
service "shorewall6" do
action [:disable, :stop]
supports :restart => true
status_command "shorewall6 status"
+ ignore_failure true
end
end