X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fvsftpd%2Fmanifests%2Fsite.pp;h=4adb08a9dabc7e4d9572692202783001a1b7015e;hb=4326b0a78553bfe9696c10f1a69e1316acd23802;hp=bc66c95d277b086e79db15dbea3deaf33a0387e1;hpb=a8faece43f89960c6686321309b3082c7a531cac;p=mirror%2Fdsa-puppet.git diff --git a/modules/vsftpd/manifests/site.pp b/modules/vsftpd/manifests/site.pp index bc66c95d2..4adb08a9d 100644 --- a/modules/vsftpd/manifests/site.pp +++ b/modules/vsftpd/manifests/site.pp @@ -1,34 +1,53 @@ -class vsftpd::site ( - $source='', - $content='', - $ensure=present, +define vsftpd::site ( + $root, + $bind='', + $chown_user='', + $writable=false, + $writable_other=false, + $banner="${name} FTP Server", + $max_clients=100, + $logfile="/var/log/ftp/vsftpd-${name}.debian.org.log", + $ensure=present ){ include vsftpd - if ($source and $content) { - fail ( "Can't have both source and content for $name" ) - } - case $ensure { present,absent: {} default: { fail ( "Invald ensure `$ensure' for $name" ) } } - if $source { - file { '/etc/vsftpd.conf': - ensure => $ensure, - source => $source, - notify => Service['vsftpd'] - } - } elsif $content { - file { '/etc/vsftpd.conf': - ensure => $ensure, - content => $content, - notify => Service['vsftpd'] - } - } else { - fail ( "Need one of source or content for $name" ) + $ftpsite = $name + + $fname = "/etc/vsftpd-${name}.conf" + + file { $fname: + ensure => $ensure, + content => template('vsftpd/vsftpd.conf.erb') + } + + file { "/etc/logrotate.d/vsftpd-${name}": + ensure => absent + } + + munin::check { "vsftpd-${name}": + script => 'vsftpd' + } + munin::conf { "vsftpd-${name}": + content => template('vsftpd/munin.erb') + } + + # We don't need a firewall rule because it's added in vsftp.pp + xinetd::service { "vsftpd-${name}": + bind => $bind, + id => "${name}-ftp", + server => '/usr/sbin/vsftpd', + service => 'ftp', + server_args => $fname, + ferm => false, + instances => $max_clients, + require => File[$fname] } + Service['vsftpd']->Service['xinetd'] }