Puppet Class: firewall
- Inherits:
- ::firewall::params
- Defined in:
- manifests/init.pp
Summary
Overview
Performs the basic setup tasks required for using the firewall resources.
At the moment this takes care of:
iptables-persistent package installation Include the firewall class for nodes that need to use the resources in this module:
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'manifests/init.pp', line 33
class firewall (
$ensure = running,
$ensure_v6 = undef,
$pkg_ensure = present,
$service_name = $firewall::params::service_name,
$service_name_v6 = $firewall::params::service_name_v6,
$package_name = $firewall::params::package_name,
$ebtables_manage = false,
) inherits ::firewall::params {
$_ensure_v6 = pick($ensure_v6, $ensure)
case $ensure {
/^(running|stopped)$/: {
# Do nothing.
}
default: {
fail("${title}: Ensure value '${ensure}' is not supported")
}
}
if $ensure_v6 {
case $ensure_v6 {
/^(running|stopped)$/: {
# Do nothing.
}
default: {
fail("${title}: ensure_v6 value '${ensure_v6}' is not supported")
}
}
}
case $::kernel {
'Linux': {
class { "${title}::linux":
ensure => $ensure,
ensure_v6 => $_ensure_v6,
pkg_ensure => $pkg_ensure,
service_name => $service_name,
service_name_v6 => $service_name_v6,
package_name => $package_name,
ebtables_manage => $ebtables_manage,
}
contain "${title}::linux"
}
'FreeBSD', 'windows': {
}
default: {
fail("${title}: Kernel '${::kernel}' is not currently supported")
}
}
}
|