summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2015-09-26 16:11:51 -0300
committerSilvio Rhatto <rhatto@riseup.net>2015-09-26 16:11:51 -0300
commit2bf05b82c9e6fc8e01cc6bbd68b2b44e8a4292ce (patch)
tree5e13b2a64384652ad5591af892e7898455116b8c /manifests
parentc741e27b5525c7a5a69451b9b8227757517b028b (diff)
downloadpuppet-websites-2bf05b82c9e6fc8e01cc6bbd68b2b44e8a4292ce.tar.gz
puppet-websites-2bf05b82c9e6fc8e01cc6bbd68b2b44e8a4292ce.tar.bz2
Move websites::hosting to websites
Diffstat (limited to 'manifests')
-rw-r--r--manifests/hosting.pp44
-rw-r--r--manifests/init.pp64
-rw-r--r--manifests/setup.pp10
3 files changed, 63 insertions, 55 deletions
diff --git a/manifests/hosting.pp b/manifests/hosting.pp
index 7546222..e69de29 100644
--- a/manifests/hosting.pp
+++ b/manifests/hosting.pp
@@ -1,44 +0,0 @@
-class websites::hosting 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 { "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,
- }
-}
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,
+ }
+}
diff --git a/manifests/setup.pp b/manifests/setup.pp
index a7ec5fb..282c892 100644
--- a/manifests/setup.pp
+++ b/manifests/setup.pp
@@ -104,14 +104,4 @@ class websites::setup {
force => true,
require => File["${apache::error_folder}", "${apache::www_folder}/images"],
}
-
- # Retrieve configured instances
- $sites = hiera('apache::sites', {})
- $databases = hiera('database::instances', {})
- $ikiwikis = hiera('ikiwiki::instances', {})
-
- # Apply instances
- create_resources('apache::site', $sites)
- create_resources('database::instance', $databases)
- create_resources('ikiwiki::instance', $ikiwikis)
}