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

  # Apply instances
  create_resources('apache::site',           $sites)
  create_resources('database::instance',     $databases)
  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,
  #}
}