default => [ '[::]' ],
}
- vsftpd::site_systemd { 'ftp':
+ vsftpd::site { 'ftp':
banner => 'ftp.debian.org FTP server',
logfile => '/var/log/ftp/vsftpd-ftp.debian.org.log',
binds => $binds,
class roles::ftp_upload {
- vsftpd::site_systemd { 'ftp-upload':
+ vsftpd::site { 'ftp-upload':
banner => 'ftp.upload.debian.org FTP server',
logfile => '/var/log/ftp/vsftpd-ftp.upload.debian.org.log',
writable => true,
key => true,
}
- vsftpd::site_systemd { 'ports-master':
+ vsftpd::site { 'ports-master':
banner => 'ports-master.debian.org FTP server',
logfile => '/var/log/ftp/vsftpd-ports-master.debian.org.log',
writable => true,
tlsaport => [443, 1873],
}
- vsftpd::site_systemd { 'security':
+ vsftpd::site { 'security':
banner => 'security-master.debian.org FTP server (vsftpd)',
logfile => '/var/log/ftp/vsftpd-security-master.debian.org.log',
writable => true,
}
if has_role('security_mirror_no_ftp') {
- vsftpd::site_systemd { 'security':
+ vsftpd::site { 'security':
ensure => absent,
root => '/nonexistent',
}
} else {
- vsftpd::site_systemd { 'security':
+ vsftpd::site { 'security':
banner => 'security.debian.org FTP server (vsftpd)',
logfile => '/var/log/ftp/vsftpd-security.debian.org.log',
max_clients => 200,
--- /dev/null
+define vsftpd::site (
+ $root,
+ $binds=['[::]'],
+ $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
+ include ferm::ftp_conntrack
+
+ case $ensure {
+ present,absent: {}
+ default: { fail ( "Invald ensure `$ensure' for $name" ) }
+ }
+
+ $ensure_service = $ensure ? {
+ present => running,
+ absent => stopped,
+ }
+
+ $ensure_enable = $ensure ? {
+ present => true,
+ absent => false,
+ }
+
+ $ftpsite = $name
+
+ $fname = "/etc/vsftpd-${name}.conf"
+
+ file { $fname:
+ ensure => $ensure,
+ content => template('vsftpd/vsftpd.conf.erb'),
+ owner => 'root',
+ group => 'root',
+ mode => '0444',
+ }
+
+ file { "/etc/logrotate.d/vsftpd-${name}":
+ ensure => absent
+ }
+
+ file { "/etc/systemd/system/vsftpd-${name}@.service":
+ ensure => $ensure,
+ content => template('vsftpd/systemd-vsftpd.service.erb'),
+ owner => 'root',
+ group => 'root',
+ mode => '0444',
+ require => File[$fname],
+ notify => Exec['systemctl daemon-reload'],
+ }
+
+ file { "/etc/systemd/system/vsftpd-${name}.socket":
+ ensure => $ensure,
+ content => template('vsftpd/systemd-vsftpd.socket.erb'),
+ owner => 'root',
+ group => 'root',
+ mode => '0444',
+ notify => [
+ Exec['systemctl daemon-reload'],
+ Service["vsftpd-${name}.socket"],
+ ],
+ }
+
+ service { "vsftpd-${name}.socket":
+ ensure => $ensure_service,
+ enable => $ensure_enable,
+ require => [
+ Exec['systemctl daemon-reload'],
+ File["/etc/systemd/system/vsftpd-${name}@.service"],
+ File["/etc/systemd/system/vsftpd-${name}.socket"],
+ ],
+ provider => systemd,
+ }
+
+ munin::check { "vsftpd-${name}":
+ ensure => $ensure,
+ script => 'vsftpd'
+ }
+ munin::conf { "vsftpd-${name}":
+ ensure => $ensure,
+ content => template('vsftpd/munin.erb')
+ }
+}
+++ /dev/null
-define vsftpd::site_systemd (
- $root,
- $binds=['[::]'],
- $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
- include ferm::ftp_conntrack
-
- case $ensure {
- present,absent: {}
- default: { fail ( "Invald ensure `$ensure' for $name" ) }
- }
-
- $ensure_service = $ensure ? {
- present => running,
- absent => stopped,
- }
-
- $ensure_enable = $ensure ? {
- present => true,
- absent => false,
- }
-
- $ftpsite = $name
-
- $fname = "/etc/vsftpd-${name}.conf"
-
- file { $fname:
- ensure => $ensure,
- content => template('vsftpd/vsftpd.conf.erb'),
- owner => 'root',
- group => 'root',
- mode => '0444',
- }
-
- file { "/etc/logrotate.d/vsftpd-${name}":
- ensure => absent
- }
-
- file { "/etc/systemd/system/vsftpd-${name}@.service":
- ensure => $ensure,
- content => template('vsftpd/systemd-vsftpd.service.erb'),
- owner => 'root',
- group => 'root',
- mode => '0444',
- require => File[$fname],
- notify => Exec['systemctl daemon-reload'],
- }
-
- file { "/etc/systemd/system/vsftpd-${name}.socket":
- ensure => $ensure,
- content => template('vsftpd/systemd-vsftpd.socket.erb'),
- owner => 'root',
- group => 'root',
- mode => '0444',
- notify => [
- Exec['systemctl daemon-reload'],
- Service["vsftpd-${name}.socket"],
- ],
- }
-
- service { "vsftpd-${name}.socket":
- ensure => $ensure_service,
- enable => $ensure_enable,
- require => [
- Exec['systemctl daemon-reload'],
- File["/etc/systemd/system/vsftpd-${name}@.service"],
- File["/etc/systemd/system/vsftpd-${name}.socket"],
- ],
- provider => systemd,
- }
-
- munin::check { "vsftpd-${name}":
- ensure => $ensure,
- script => 'vsftpd'
- }
- munin::conf { "vsftpd-${name}":
- ensure => $ensure,
- content => template('vsftpd/munin.erb')
- }
-}