aboutsummaryrefslogtreecommitdiff
path: root/manifests/chain.pp
blob: 6f2ee1d86d019aec98dbc9a86c372e8ea1455a1a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# defined resource which creates all rules for one chain
# @param policy [Ferm::Policies] Set the default policy for a CHAIN
# @param chain [Ferm::Chains] name of the chain that should be managed
define ferm::chain (
  Ferm::Policies $policy,
  Ferm::Chains $chain = $name,
) {

  # concat resource for the chain
  $filename = downcase($chain)
  concat{"/etc/ferm.d/chains/${chain}.conf":
    ensure  => 'present',
  }

  concat::fragment{"${chain}-policy":
    target  => "/etc/ferm.d/chains/${chain}.conf",
    content => epp("${module_name}/ferm_chain_header.conf.epp", {'policy' => $policy }),
    order   => '01',
  }
}