summaryrefslogtreecommitdiff
path: root/manifests/base.pp
blob: 0f942a58205f82af3ccef3f62284ccf8383273a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# manages the base stuff of
# a lighttpd server
class lighttpd::base {
  package{'lighttpd':
    ensure => installed,
  }

  service{'lighttpd':
    ensure    => running,
    enable    => true,
    hasstatus => true,
    require   => Package['lighttpd'],
  }

  file{
    '/etc/lighttpd/lighttpd.conf':
      source  => [  "puppet:///modules/site_lighttpd/${::fqdn}/lighttpd.conf",
                    'puppet:///modules/site_lighttpd/lighttpd.conf',
                    "puppet:///modules/lighttpd/${::operatingsystem}/lighttpd.conf",
                    'puppet:///modules/lighttpd/lighttpd.conf' ],
      require => Package['lighttpd'],
      notify  => Service['lighttpd'],
      owner   => 'root',
      group   => 0,
      mode    => '0644';
    # ToDo: put that in a common module to share with apache
    'default_lighttpd_index':
      ensure  => file,
      path    => '/var/www/lighttpd/index.html',
      content => template('lighttpd/default/default_index.erb'),
      require => Package['lighttpd'],
      before  => Service['lighttpd'],
      owner   => 'root',
      group   => 0,
      mode    => '0644';
    "${lighttpd::conf_dir}/config.conf":
      ensure  => file,
      require => Package['lighttpd'],
      before  => Service['lighttpd'],
      owner   => 'root',
      group   => 0,
      mode    => '0644';
    '/etc/cron.daily/clean_lighttpd_compress':
      content => "find /var/cache/lighttpd/compress -type f -mtime +10 | xargs -r rm\n",
      require => Package['lighttpd'],
      owner   => 'root',
      group   => 0,
      mode    => '0640';
  }
}