summaryrefslogtreecommitdiff
path: root/manifests/hosting.pp
blob: 309e84082948afb61ddbf8488d92d73c36b4e6eb (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
class websites::hosting inherits websites::setup {
  # Include the needed classes for website hosting
  include php
  include trac
  include websvn
  include moin
  include apache::rails

  # Declare the needed classes for website hosting 
  class { [ 'drupal', 'ikiwiki', 'pmwiki', 'hotglue', 'wordpress' ]: }
  class {
    'viewvc':
      root_parents => "/var/svn : svn";
  }

  $git_daemon = hiera('nodo::web::git_daemon', True)

  if $git_daemon != false {
    class { 'gitweb': }
  }

  apache::site { "images":
    docroot => "${apache::www_folder}/images",
    mpm     => false,
    tag     => 'all',
  }

  # Remove untagged site instances
  Apache::Site <| tag != $::hostname and tag != 'all' |> {
    ensure => absent,
  }

  # Remove untagged database instances
  Database::Instance <| tag != $::hostname and tag != 'all' |> {
    ensure => absent,
  }

  # Remove untagged ikiwiki instances
  Ikiwiki::Instance <| tag != $::hostname and tag != 'all' |> {
    ensure => absent,
  }
}