Report abuse

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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
class site::web-base inherits apache{
  include site::digg-php

  Apache::Module {
    notify => Service["apache"]
  }

  apache::module {
    [ "alias", "auth_basic", "authn_file", "authz_default", "authz_groupfile" ]:
      ensure => installed;
    [ "authz_host", "authz_user", "autoindex", "cgi", "dir", "env", "headers" ]:
      ensure => installed;
    [ "mime", "negotiation", "rewrite", "setenvif", "status", "userdir"]:
      ensure => installed;
    "php5":
      ensure => installed,
      require => [ Package["php"], Package["mod-php"] ];
  }

  apache::config {
    "base-config":
      order => 000,
      content => template("site/apache/base-config.erb"),
      ensure => present;
    "ports":
      order => 010,
      content => template("site/apache/ports.erb"),
      ensure => present;
  }

  package {
    "ca-certificates": ensure => installed;
    "cronolog": ensure => installed;
    "openssl": ensure => installed;
    "smtpd": ensure => $operatingsystemrelease ? {
      "4.0" => purged,
      default => undef
      };
    "ssl-cert": ensure => installed;
  }

  realize File["delete-old-files"]

  cron {
    "clean-old-logs":
      command => "/usr/bin/find /var/log/apache2 -maxdepth 1 -xdev -mtime 5 -type f -delete",
      hour   => 2,
      minute => 20;
  }

  file {
    "/etc/logrotate.d/apache2":
      ensure => absent;
    "/etc/logrotate.d/php":
      source => "puppet:///site/logrotate/php";
    "/etc/mailname":
      notify => Exec["update-exim4.conf"],
      content => "digg.com\n";
    "/etc/php4":
      recurse => true,
      force  => true,
      ensure => absent;
    "/etc/php5":
      ensure => directory;
    "/etc/php5/apache2":
      ensure => directory;
    "/etc/php5/apache2/php.ini":
      notify => Service["apache2"],
      content => template("site/php/php-apache2.ini.erb");
    "/etc/php5/cli":
      ensure => directory;
    "/etc/php5/cli/php.ini":
      content => template("site/php/php-cli.ini.erb");
    "/var/log/apache2/php":
      require => Package["apache2"],
      owner => www-data,
      group => www-data,
      ensure => directory;
  }
}