summaryrefslogtreecommitdiff
path: root/manifests/resources.pp
blob: 498d498f95360dd8c0ba3b2a4f010bf2f29e3627 (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
class websites::resources {
  # Retrieve configured instances
  $sites            = lookup('apache::sites', undef, undef,           {})
  $modules          = lookup('apache::modules', undef, undef,         {})
  $configs          = lookup('apache::configs', undef, undef,         {})
  $databases        = lookup('database::instances', undef, undef,     {})
  $database_configs = lookup('database::configs', undef, undef,       {})
  $ikiwikis         = lookup('ikiwiki::instances', undef, undef,      {})
  $domains          = lookup('domain_check::instances', undef, undef, {})

  # Apply instances
  create_resources('apache::site',           $sites)
  create_resources('apache::module',         $modules)
  create_resources('apache::config',         $configs)
  create_resources('database::instance',     $databases)
  create_resources('database::config',       $database_configs)
  create_resources('ikiwiki::instance',      $ikiwikis)
  create_resources('domain_check::instance', $domains)

  # 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,
  #}
}