+++ /dev/null
-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
-
- case $ensure {
- present,absent: {}
- default: { fail ( "Invald ensure `$ensure' 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}":
- ensure => $ensure,
- script => 'vsftpd'
- }
- munin::conf { "vsftpd-${name}":
- ensure => $ensure,
- content => template('vsftpd/munin.erb')
- }
-
- # We don't need a firewall rule because it's added in vsftp.pp
- xinetd::service { "vsftpd-${name}":
- ensure => $ensure,
- 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']
-}
Exec['systemctl daemon-reload'],
File["/etc/systemd/system/vsftpd-${name}@.service"],
File["/etc/systemd/system/vsftpd-${name}.socket"],
- Service['xinetd'],
],
provider => systemd,
}
- xinetd::service { [ "vsftpd-${name}", "vsftpd-${name}6", "vsftpd-${name}-v6" ]:
- ensure => absent,
- id => 'unused',
- server => 'unused',
- service => 'unused',
- ferm => false,
- before => Service["vsftpd-${name}.socket"],
- }
-
munin::check { "vsftpd-${name}":
ensure => $ensure,
script => 'vsftpd'