]> git.donarmstrong.com Git - dsa-puppet.git/blob - modules/vsftpd/manifests/site.pp
Revert "s/name/title/ in a few places"
[dsa-puppet.git] / modules / vsftpd / manifests / site.pp
1 class vsftpd::site (
2         $source='',
3         $content='',
4         $bind=$::ipaddress,
5         $ensure=present
6 ){
7
8         include vsftpd::nolisten
9
10         if ($source and $content) {
11                 fail ( "Can't have both source and content for $name" )
12         }
13
14         case $ensure {
15                 present,absent: {}
16                 default: { fail ( "Invald ensure `$ensure' for $name" ) }
17         }
18
19         $fname = "/etc/vsftpd-${name}.conf"
20
21         if $source {
22                 file { $fname:
23                         ensure => $ensure,
24                         noop   => true,
25                         source => $source,
26                 }
27         } elsif $content {
28                 file { $fname:
29                         ensure  => $ensure,
30                         noop    => true,
31                         content => $content,
32                 }
33         } else {
34                 fail ( "Need one of source or content for $name" )
35         }
36
37         # We don't need a firewall rule because it's added in vsftp.pp
38         xinetd::service { "vsftpd-${name}":
39                 bind        => $bind,
40                 id          => $name,
41                 server      => '/usr/sbin/vsftpd',
42                 port        => 'ftp',
43                 server_args => $fname,
44                 ferm        => false,
45         }
46
47 }