]> git.donarmstrong.com Git - dsa-puppet.git/blobdiff - modules/vsftpd/manifests/init.pp
Ensure the /var/run/vsftpd/empty exists as vsftpd is broken without it
[dsa-puppet.git] / modules / vsftpd / manifests / init.pp
index 451706e193f189e347b5c9c615438892aacf9945..0ad87bad2f95232cbf403d443ab0dc9953e9412d 100644 (file)
@@ -8,11 +8,32 @@ class vsftpd {
        }
 
        service { 'vsftpd':
-               ensure  => running,
+               ensure  => stopped,
                require => Package['vsftpd']
        }
 
-       munin::check { 'vsftpd': }
+       file { '/etc/vsftpd.conf':
+               content => "listen=NO\n",
+               require => Package['vsftpd'],
+               notify  => Service['vsftpd']
+       }
+
+       # Mask the vsftpd service as we are using xinetd
+       file { '/etc/systemd/system/vsftpd.service':
+               ensure => 'link',
+               target => '/dev/null',
+               notify => Exec['systemctl daemon-reload'],
+       }
+
+       # Ensure the empty dir is present, workaround for #789127
+       file { '/etc/tmpfiles.d/vsftpd.conf':
+               content => 'd /var/run/vsftpd/empty 0755 root root -'
+               notify => Exec['systemd-tmpfiles --create --exclude-prefix=/dev'],
+       }
+
+       munin::check { 'vsftpd':
+               ensure => absent
+       }
        munin::check { 'ps_vsftpd':
                script => 'ps_'
        }
@@ -22,4 +43,16 @@ class vsftpd {
                description => 'Allow ftp access',
                rule        => '&SERVICE(tcp, 21)',
        }
+
+       file { '/var/log/ftp':
+               ensure => directory,
+               mode   => '0755'
+       }
+       file { '/etc/logrotate.d/vsftpd':
+               source  => 'puppet:///modules/vsftpd/logrotate.conf',
+               require => [
+                       Package['vsftpd'],
+                       Package['debian.org']
+               ]
+       }
 }