Skip to content

Commit

Permalink
Merge pull request #23 from rehanone/develop/ferm-as-firewall
Browse files Browse the repository at this point in the history
- Apply firewall rules if `ferm` is defined as firewall manager. It u…
  • Loading branch information
rehanone authored May 6, 2020
2 parents f4f4f32 + 794be5c commit c30a6c7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
21 changes: 16 additions & 5 deletions manifests/firewall.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,23 @@

assert_private("Use of private class ${name} by ${caller_module_name}")

if $nginx::firewall_manage and defined('::firewall') {
if $nginx::firewall_manage {
$nginx::service_ports.each |$port, $proto| {
firewall { "${port} Allow inbound ${proto} connection on port: ${port}":
dport => $port,
proto => $proto,
action => accept,
if defined('::firewall') {
firewall { "${port} - NGINX - Allow inbound ${proto} connection on port: ${port}":
dport => $port,
proto => $proto,
action => accept,
}
}

if defined('::ferm') {
ferm::rule { "NGINX - Allow inbound ${proto} connection on port: ${port}":
chain => 'INPUT',
proto => $proto,
dport => "(${port})",
action => 'ACCEPT',
}
}
}
}
Expand Down
10 changes: 0 additions & 10 deletions spec/acceptance/nodesets/default.yml

This file was deleted.

0 comments on commit c30a6c7

Please sign in to comment.