diff options
Diffstat (limited to 'manifests/init.pp')
-rw-r--r-- | manifests/init.pp | 64 |
1 files changed, 63 insertions, 1 deletions
diff --git a/manifests/init.pp b/manifests/init.pp index 8f8b440..c67e285 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -1 +1,63 @@ -# Websites module +class websites inherits websites::setup { + # Include the needed classes for website hosting + include php + include trac + include websvn + include moin + include apache::rails + include rsync::rrsync + + # 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 { 'git::gitweb': } + class { 'git::cgit': } + + apache::site { "git": + source => true, + docroot => '/var/git/repositories', + mpm => false, + tag => 'all', + } + } + + apache::site { "images": + docroot => "${apache::www_folder}/images", + mpm => false, + tag => 'all', + } + + # Retrieve configured instances + $sites = hiera('apache::sites', {}) + $databases = hiera('database::instances', {}) + $ikiwikis = hiera('ikiwiki::instances', {}) + $domains = hiera('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, + } +} |