]> git.donarmstrong.com Git - dsa-puppet.git/blob - modules/apache2/manifests/init.pp
and the inevitable typo
[dsa-puppet.git] / modules / apache2 / manifests / init.pp
1 define enable_module($module) {
2         exec { "/usr/sbin/a2enmod $module": }
3 }
4
5 class apache2 {
6         package {
7                 apache2: ensure => installed;
8                 logrotate: ensure => installed;
9         }
10
11         enable_module {
12                 "info": module => info;
13                 "status": module => status;
14         }
15
16         file {
17                 "/etc/apache2/conf.d/ressource-limits":
18                         content => template("apache2/ressource-limits.erb"),
19                         require => Package["apache2"],
20                         notify  => Exec["apache2 reload"];
21                 "/etc/apache2/conf.d/security":
22                         source  => [ "puppet:///apache2/per-host/$fqdn/etc/apache2/conf.d/security",
23                                      "puppet:///apache2/common/etc/apache2/conf.d/security" ],
24                         require => Package["apache2"],
25                         notify  => Exec["apache2 reload"];
26                 "/etc/apache2/conf.d/local-serverinfo":
27                         source  => [ "puppet:///apache2/per-host/$fqdn/etc/apache2/conf.d/local-serverinfo",
28                                      "puppet:///apache2/common/etc/apache2/conf.d/local-serverinfo" ],
29                         require => Package["apache2"],
30                         notify  => Exec["apache2 reload"];
31                 "/etc/apache2/conf.d/server-status":
32                         source  => [ "puppet:///apache2/per-host/$fqdn/etc/apache2/conf.d/server-status",
33                                      "puppet:///apache2/common/etc/apache2/conf.d/server-status" ],
34                         require => Package["apache2"],
35                         notify  => Exec["apache2 reload"];
36
37                 "/etc/apache2/sites-available/default-debian.org":
38                         source  => [ "puppet:///apache2/per-host/$fqdn/etc/apache2/sites-available/default-debian.org",
39                                      "puppet:///apache2/common/etc/apache2/sites-available/default-debian.org" ],
40                         require => Package["apache2"],
41                         notify  => Exec["apache2 reload"];
42
43                 "/etc/logrotate.d/apache2":
44                         source  => [ "puppet:///apache2/per-host/$fqdn/etc/logrotate.d/apache2",
45                                      "puppet:///apache2/common/etc/logrotate.d/apache2" ];
46
47                 "/srv/www":
48                         mode    => 755,
49                         ensure  => directory;
50                 "/srv/www/default.debian.org":
51                         mode    => 755,
52                         ensure  => directory;
53                 "/srv/www/default.debian.org/htdocs":
54                         mode    => 755,
55                         ensure  => directory;
56                 "/srv/www/default.debian.org/htdocs/index.html":
57                         content => template("apache2/default-index.html");
58
59                 # sometimes this is a symlink
60                 #"/var/log/apache2":
61                 #       mode    => 755,
62                 #       ensure  => directory;
63         }
64
65         exec { "apache2 reload":
66                 path        => "/etc/init.d:/usr/bin:/usr/sbin:/bin:/sbin",
67                 refreshonly => true,
68         }
69 }