X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fferm%2Fmanifests%2Finit.pp;h=196a39e9187133dd4c8e3aa19930ccb0b5faa220;hb=93481f49de29f36f8116229d46f4d29e452af8f5;hp=9290d35c0452d771e7d6041ed08caf9c11e795a9;hpb=f2c3ac3b6d62f9e0d049e370aa031daea503b7c7;p=mirror%2Fdsa-puppet.git diff --git a/modules/ferm/manifests/init.pp b/modules/ferm/manifests/init.pp index 9290d35c0..196a39e91 100644 --- a/modules/ferm/manifests/init.pp +++ b/modules/ferm/manifests/init.pp @@ -28,23 +28,25 @@ class ferm { hasstatus => false, status => '/bin/true', } + exec { + "ferm reload": + command => "service ferm reload", + refreshonly => true, + } - $munin_ips = split(regsubst($::v4ips, '([^,]+)', 'ip_\1', 'G'), ',') - munin::check { $munin_ips: script => 'ip_', } + $munin_ips = getfromhash($site::nodeinfo, 'misc', 'v4addrs') + .map |$addr| { "ip_${addr}" } - if $v6ips { - $munin6_ips = split(regsubst($::v6ips, '([^,]+)', 'ip_\1', 'G'), ',') - munin::ipv6check { $munin6_ips: } - } + munin::check { $munin_ips: script => 'ip_', } - # get rid of old stuff - $munin6_ip6s = split(regsubst($::v6ips, '([^,]+)', 'ip6_\1', 'G'), ',') - munin::check { $munin6_ip6s: ensure => absent } + $munin6_ips = getfromhash($site::nodeinfo, 'misc', 'v6addrs') + .map |$addr| { "ip_${addr}" } + munin::ipv6check { $munin6_ips: } file { '/etc/ferm': ensure => directory, - notify => Service['ferm'], + notify => Exec['ferm reload'], require => Package['ferm'], mode => '0755' } @@ -67,29 +69,50 @@ class ferm { file { '/etc/default/ferm': source => 'puppet:///modules/ferm/ferm.default', require => Package['ferm'], - notify => Service['ferm'], + notify => Exec['ferm reload'], mode => '0444', } file { '/etc/ferm/ferm.conf': content => template('ferm/ferm.conf.erb'), - notify => Service['ferm'], + notify => Exec['ferm reload'], } file { '/etc/ferm/conf.d/00-init.conf': content => template('ferm/00-init.conf.erb'), - notify => Service['ferm'], + notify => Exec['ferm reload'], } file { '/etc/ferm/conf.d/me.conf': content => template('ferm/me.conf.erb'), - notify => Service['ferm'], + notify => Exec['ferm reload'], } file { '/etc/ferm/conf.d/defs.conf': content => template('ferm/defs.conf.erb'), - notify => Service['ferm'], + notify => Exec['ferm reload'], } - file { '/etc/ferm/conf.d/interfaces.conf': - content => template('ferm/interfaces.conf.erb'), - notify => Service['ferm'], + + file { '/etc/ferm/conf.d/50-munin-interfaces.conf': + content => template('ferm/conf.d-munin-interfaces.conf.erb'), + notify => Exec['ferm reload'], + } + @ferm::rule { 'dsa-munin-interfaces-in': + prio => '001', + description => 'munin accounting', + chain => 'INPUT', + domain => '(ip ip6)', + rule => 'daddr ($MUNIN_IPS) NOP' + } + @ferm::rule { 'dsa-munin-interfaces-out': + prio => '001', + description => 'munin accounting', + chain => 'OUTPUT', + domain => '(ip ip6)', + rule => 'saddr ($MUNIN_IPS) NOP' + } + + file { '/etc/ferm/dsa.d/010-base.conf': + content => template('ferm/dsa.d-010-base.conf.erb'), + notify => Exec['ferm reload'], } + augeas { 'logrotate_ulogd2': context => '/files/etc/logrotate.d/ulogd2', changes => [