$mxinfo = allnodeinfo("mXRecord")
- include ferm
include munin-node
include sudo
include ssh
}
case $hostname {
- logtest01: { include ferm::real }
+ logtest01: { include ferm }
}
case $hostname {
geo1,geo2,geo3: { include named::geodns }
command => "/etc/init.d/apache2 force-reload",
refreshonly => true,
}
- ferm::rule { "dsa-apache":
+ @ferm::rule { "dsa-apache":
domain => "(ip ip6)",
description => "Allow web access",
rule => "proto tcp mod state state (NEW) dport (80) ACCEPT"
path => "/etc/init.d:/usr/bin:/usr/sbin:/bin:/sbin",
refreshonly => true,
}
- ferm::rule { "dsa-exim":
+ @ferm::rule { "dsa-exim":
domain => "(ip ip6)",
description => "Allow smtp access",
rule => "proto tcp mod state state (NEW) dport (25) ACCEPT"
}
}
+ # realize (i.e. enable) all @ferm::rule virtual resources
+ Rule <| |>
+
+ package { ferm: ensure => installed }
+
file {
- "/etc/ferm":
- ensure => directory;
- "/etc/ferm/dsa.d":
- ensure => directory;
+ "/etc/ferm/dsa.d":
+ ensure => directory,
+ purge => true,
+ force => true,
+ recurse => true,
+ source => "puppet:///files/empty/",
+ require => Package["ferm"];
+ "/etc/ferm/conf.d":
+ ensure => directory,
+ require => Package["ferm"];
+ "/etc/ferm/ferm.conf":
+ source => "puppet:///ferm/ferm.conf",
+ require => Package["ferm"],
+ mode => 0400,
+ notify => Exec["ferm restart"];
+ "/etc/ferm/conf.d/me.conf":
+ content => template("ferm/me.conf.erb"),
+ require => Package["ferm"],
+ mode => 0400,
+ notify => Exec["ferm restart"];
+ "/etc/ferm/conf.d/defs.conf":
+ source => "puppet:///ferm/defs.conf",
+ require => Package["ferm"],
+ mode => 0400,
+ notify => Exec["ferm restart"];
}
exec { "ferm restart":
- command => "/bin/true",
+ command => "/etc/init.d/ferm restart",
refreshonly => true,
}
+++ /dev/null
-class ferm::real inherits ferm {
-
- package { ferm: ensure => installed }
-
- file {
- "/etc/ferm/conf.d":
- ensure => directory,
- require => Package["ferm"];
- "/etc/ferm/ferm.conf":
- source => "puppet:///ferm/ferm.conf",
- require => Package["ferm"],
- mode => 0400,
- notify => Exec["ferm restart"];
- "/etc/ferm/conf.d/me.conf":
- content => template("ferm/me.conf.erb"),
- require => Package["ferm"],
- mode => 0400,
- notify => Exec["ferm restart"];
- "/etc/ferm/conf.d/defs.conf":
- source => "puppet:///ferm/defs.conf",
- require => Package["ferm"],
- mode => 0400,
- notify => Exec["ferm restart"];
- }
-
- Exec["ferm restart"] {
- command => "/etc/init.d/ferm restart",
- refreshonly => true,
- }
-}
path => "/etc/init.d:/usr/bin:/usr/sbin:/bin:/sbin",
refreshonly => true,
}
- ferm::rule { "dsa-munin":
+ @ferm::rule { "dsa-munin":
description => "Allow munin from munin master",
rule => "proto tcp mod state state (NEW) dport (munin) @subchain 'munin' { saddr (\$HOST_MUNIN) ACCEPT; }"
}
path => "/etc/init.d:/usr/bin:/usr/sbin:/bin:/sbin",
refreshonly => true,
}
- ferm::rule { "dsa-nagios":
+ @ferm::rule { "dsa-nagios":
description => "Allow nrpe from nagios master",
rule => "proto tcp mod state state (NEW) dport (5666) @subchain 'nagios' { saddr (\$HOST_NAGIOS) ACCEPT; }"
}
mode => 775,
;
}
- ferm::rule { "dsa-bind":
+ @ferm::rule { "dsa-bind":
domain => "(ip ip6)",
description => "Allow nameserver access",
rule => "proto (udp tcp) mod state state (NEW) dport (53) ACCEPT"
path => "/etc/init.d:/usr/bin:/usr/sbin:/bin:/sbin",
refreshonly => true,
}
- ferm::rule { "dsa-ntp":
+ @ferm::rule { "dsa-ntp":
domain => "(ip ip6)",
description => "Allow ntp access",
rule => "proto udp mod state state (NEW) dport (123) ACCEPT"
refreshonly => true,
}
- ferm::rule { "dsa-ssh":
+ @ferm::rule { "dsa-ssh":
description => "Allow SSH from DSA",
rule => "proto tcp mod state state (NEW) dport (ssh) @subchain 'ssh' { saddr (\$SSH_SOURCES) ACCEPT; }"
}
- ferm::rule { "dsa-ssh-v6":
+ @ferm::rule { "dsa-ssh-v6":
description => "Allow SSH from DSA",
domain => "ip6",
rule => "proto tcp mod state state (NEW) dport (ssh) @subchain 'ssh' { saddr (\$SSH_V6_SOURCES) ACCEPT; }"