]> git.donarmstrong.com Git - dsa-puppet.git/blob - modules/apache2/manifests/init.pp
apache hosts load mod info and status, and serve it
[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                 "/etc/apache2/conf.d/server-status":
31                         source  => [ "puppet:///apache2/per-host/$fqdn/etc/apache2/conf.d/server-status",
32                                      "puppet:///apache2/common/etc/apache2/conf.d/server-status" ],
33                         require => Package["apache2"],
34                         notify  => Exec["apache2 reload"];
35
36                 "/etc/apache2/sites-available/default-debian.org":
37                         source  => [ "puppet:///apache2/per-host/$fqdn/etc/apache2/sites-available/default-debian.org",
38                                      "puppet:///apache2/common/etc/apache2/sites-available/default-debian.org" ],
39                         require => Package["apache2"],
40                         notify  => Exec["apache2 reload"];
41
42                 "/etc/logrotate.d/apache2":
43                         source  => [ "puppet:///apache2/per-host/$fqdn/etc/logrotate.d/apache2",
44                                      "puppet:///apache2/common/etc/logrotate.d/apache2" ];
45
46                 "/srv/www":
47                         mode    => 755,
48                         ensure  => directory;
49                 "/srv/www/default.debian.org":
50                         mode    => 755,
51                         ensure  => directory;
52                 "/srv/www/default.debian.org/htdocs":
53                         mode    => 755,
54                         ensure  => directory;
55                 "/srv/www/default.debian.org/htdocs/index.html":
56                         content => template("apache2/default-index.html");
57
58                 # sometimes this is a symlink
59                 #"/var/log/apache2":
60                 #       mode    => 755,
61                 #       ensure  => directory;
62         }
63
64         exec { "apache2 reload":
65                 path        => "/etc/init.d:/usr/bin:/usr/sbin:/bin:/sbin",
66                 refreshonly => true,
67         }
68 }