fuel-library/deployment/puppet/firewall/manifests/linux.pp
Bogdan Dobrelya 2f07b9f5c2 Sync firewall module from puppetlabs upstream
v1.0.2 48bb506853b3364969a6148e26861302872d1c31

Closes-bug: #1318613

Change-Id: I8f691ef7f46682d00760fcb66b0b7bf673efae0b
Signed-off-by: Bogdan Dobrelya <bdobrelia@mirantis.com>
2014-06-06 13:06:12 +03:00

52 lines
1.2 KiB
Puppet

# = Class: firewall::linux
#
# Installs the `iptables` package for Linux operating systems and includes
# the appropriate sub-class for any distribution specific services and
# additional packages.
#
# == Parameters:
#
# [*ensure*]
# Ensure parameter passed onto Service[] resources. When `running` the
# service will be started on boot, and when `stopped` it will not.
# Default: running
#
class firewall::linux (
$ensure = running
) {
$enable = $ensure ? {
running => true,
stopped => false,
}
package { 'iptables':
ensure => present,
}
case $::operatingsystem {
'RedHat', 'CentOS', 'Fedora', 'Scientific', 'SL', 'SLC', 'Ascendos',
'CloudLinux', 'PSBM', 'OracleLinux', 'OVS', 'OEL', 'Amazon', 'XenServer': {
class { "${title}::redhat":
ensure => $ensure,
enable => $enable,
require => Package['iptables'],
}
}
'Debian', 'Ubuntu': {
class { "${title}::debian":
ensure => $ensure,
enable => $enable,
require => Package['iptables'],
}
}
'Archlinux': {
class { "${title}::archlinux":
ensure => $ensure,
enable => $enable,
require => Package['iptables'],
}
}
default: {}
}
}