Sha256: 52229d0782e5205b18514db83c02276af911625c139574946449841ed1ffde8c

Contents?: true

Size: 1.29 KB

Versions: 20

Compression:

Stored size: 1.29 KB

Contents

# = Class: firewall::linux::debian
#
# Installs the `iptables-persistent` package for Debian-alike systems. This
# allows rules to be stored to file and restored on boot.
#
# == Parameters:
#
# [*ensure*]
#   Ensure parameter passed onto Service[] resources.
#   Default: running
#
# [*enable*]
#   Enable parameter passed onto Service[] resources.
#   Default: true
#
class firewall::linux::debian (
  $ensure = running,
  $enable = true
) {
  package { 'iptables-persistent':
    ensure => present,
  }

  if($::operatingsystemrelease =~ /^6\./ and $enable == true
  and versioncmp($::iptables_persistent_version, '0.5.0') < 0 ) {
    # This fixes a bug in the iptables-persistent LSB headers in 6.x, without it
    # we lose idempotency
    exec { 'iptables-persistent-enable':
      logoutput => on_failure,
      command   => '/usr/sbin/update-rc.d iptables-persistent enable',
      unless    => '/usr/bin/test -f /etc/rcS.d/S*iptables-persistent',
      require   => Package['iptables-persistent'],
    }
  } else {
    # This isn't a real service/daemon. The start action loads rules, so just
    # needs to be called on system boot.
    service { 'iptables-persistent':
      ensure    => undef,
      enable    => $enable,
      hasstatus => true,
      require   => Package['iptables-persistent'],
    }
  }
}

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
freighthop-0.6.1 modules/firewall/manifests/linux/debian.pp
freighthop-0.6.0 modules/firewall/manifests/linux/debian.pp
freighthop-0.5.2 modules/firewall/manifests/linux/debian.pp
freighthop-0.5.1 modules/firewall/manifests/linux/debian.pp
freighthop-0.5.0 modules/firewall/manifests/linux/debian.pp
freighthop-0.4.1 modules/firewall/manifests/linux/debian.pp
freighthop-0.4.0 modules/firewall/manifests/linux/debian.pp
freighthop-0.3.3 modules/firewall/manifests/linux/debian.pp
freighthop-0.3.2 modules/firewall/manifests/linux/debian.pp
freighthop-0.3.1 modules/firewall/manifests/linux/debian.pp
freighthop-0.3.0 modules/firewall/manifests/linux/debian.pp
freighthop-0.2.1 modules/firewall/manifests/linux/debian.pp
freighthop-0.2.0 modules/firewall/manifests/linux/debian.pp
freighthop-0.1.0 modules/firewall/manifests/linux/debian.pp
freighthop-0.0.6 modules/firewall/manifests/linux/debian.pp
freighthop-0.0.5 modules/firewall/manifests/linux/debian.pp
freighthop-0.0.4 modules/firewall/manifests/linux/debian.pp
freighthop-0.0.3 modules/firewall/manifests/linux/debian.pp
freighthop-0.0.2 modules/firewall/manifests/linux/debian.pp
freighthop-0.0.1 modules/firewall/manifests/linux/debian.pp