X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fvsftpd%2Fmanifests%2Fsite.pp;h=f8a71a0fb52d9aa297949593bf0df5af0efb635a;hb=08f0d0dcaeccad3e7950f07581538aae180748fb;hp=3f1deeb7c962a56c578ae5781bbfac416570b14e;hpb=64497f03874c0bbf33be7fa6287dd769cded0751;p=mirror%2Fdsa-puppet.git diff --git a/modules/vsftpd/manifests/site.pp b/modules/vsftpd/manifests/site.pp index 3f1deeb7c..f8a71a0fb 100644 --- a/modules/vsftpd/manifests/site.pp +++ b/modules/vsftpd/manifests/site.pp @@ -1,47 +1,52 @@ -class vsftpd::site ( - $source='', - $content='', - $bind=$::ipaddress, +define vsftpd::site ( + $root, + $bind='', + $chown_user='', + $writable=false, + $banner="${name} FTP Server", + $max_clients=100, + $logfile="/var/log/ftp/vsftpd-${name}.debian.org.log", $ensure=present ){ - include vsftpd::nolisten - - if ($source and $content) { - fail ( "Can't have both source and content for $name" ) - } + include vsftpd case $ensure { present,absent: {} default: { fail ( "Invald ensure `$ensure' for $name" ) } } + $ftpsite = $name + $fname = "/etc/vsftpd-${name}.conf" - if $source { - file { $fname: - ensure => $ensure, - noop => true, - source => $source, - } - } elsif $content { - file { $fname: - ensure => $ensure, - noop => true, - content => $content, - } - } else { - fail ( "Need one of source or content for $name" ) + 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-${title}": + xinetd::service { "vsftpd-${name}": bind => $bind, - id => $name, + id => "${name}-ftp", server => '/usr/sbin/vsftpd', port => 'ftp', server_args => $fname, ferm => false, + instances => $max_clients, + require => File[$fname] } + Service['vsftpd']->Service['xinetd'] }