fail2ban: lint fixes
authorAdam D. Barratt <adam@adam-barratt.org.uk>
Sun, 20 Oct 2019 11:45:59 +0000 (12:45 +0100)
committerAdam D. Barratt <adam@adam-barratt.org.uk>
Sun, 20 Oct 2019 11:45:59 +0000 (12:45 +0100)
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
modules/fail2ban/manifests/exim.pp
modules/fail2ban/manifests/init.pp
modules/fail2ban/manifests/postfix.pp

index 96c9561..4279091 100644 (file)
@@ -1,18 +1,20 @@
+# exim-specific fail2ban setup
+#
 class fail2ban::exim inherits fail2ban {
        file { '/etc/fail2ban/filter.d/dsa-exim.conf':
                source => 'puppet:///modules/fail2ban/filter/dsa-exim.conf',
-               notify  => Service['fail2ban'],
+               notify => Service['fail2ban'],
        }
        file { '/etc/fail2ban/jail.d/dsa-exim.conf':
                source => 'puppet:///modules/fail2ban/jail/dsa-exim.conf',
-               notify  => Service['fail2ban'],
+               notify => Service['fail2ban'],
        }
        file { '/etc/fail2ban/filter.d/dsa-exim-strict.conf':
                source => 'puppet:///modules/fail2ban/filter/dsa-exim-strict.conf',
-               notify  => Service['fail2ban'],
+               notify => Service['fail2ban'],
        }
        file { '/etc/fail2ban/jail.d/dsa-exim-strict.conf':
                source => 'puppet:///modules/fail2ban/jail/dsa-exim-strict.conf',
-               notify  => Service['fail2ban'],
+               notify => Service['fail2ban'],
        }
 }
index f4f7b9f..b85b009 100644 (file)
@@ -1,3 +1,7 @@
+# fail2ban setup
+#
+# Checks that are only used on particular systems are defined elsewhere,
+# generally in subclasses.
 class fail2ban {
        package { 'fail2ban':
                ensure => installed,
@@ -9,7 +13,7 @@ class fail2ban {
 
        file { '/etc/fail2ban/jail.d/dsa-00-default.conf':
                source => 'puppet:///modules/fail2ban/jail/dsa-00-default.conf',
-               notify  => Service['fail2ban'],
+               notify => Service['fail2ban'],
        }
 
        ferm::conf { 'f2b':
@@ -37,8 +41,8 @@ class fail2ban {
 
        # XXX Maybe this will be automatically done in buster, it is certainly needed in stretch. So maybe:  versioncmp($::lsbmajdistrelease, '9') <= 0
        concat::fragment { 'puppet-crontab--fail2ban-cleanup':
-               target => '/etc/cron.d/puppet-crontab',
-               content  => @(EOF)
+               target  => '/etc/cron.d/puppet-crontab',
+               content => @(EOF)
                        17 * * * * root chronic python3 -c "import sys, logging; logging.basicConfig(stream=sys.stdout, level=logging.INFO); from fail2ban.server.database import Fail2BanDb; db = Fail2BanDb('/var/lib/fail2ban/fail2ban.sqlite3'); db.purge(); db._db.cursor().execute('VACUUM')"
                        | EOF
        }
index 4b54566..f6f5f68 100644 (file)
@@ -1,10 +1,12 @@
+# postfix-specific fail2ban setup
+#
 class fail2ban::postfix inherits fail2ban {
        file { '/etc/fail2ban/filter.d/dsa-postfix.conf':
                source => 'puppet:///modules/fail2ban/filter/dsa-postfix.conf',
-               notify  => Service['fail2ban'],
+               notify => Service['fail2ban'],
        }
        file { '/etc/fail2ban/jail.d/dsa-postfix.conf':
                source => 'puppet:///modules/fail2ban/jail/dsa-postfix.conf',
-               notify  => Service['fail2ban'],
+               notify => Service['fail2ban'],
        }
 }