diff options
author | Michael Scherer <misc@mageia.org> | 2012-01-08 20:25:06 +0000 |
---|---|---|
committer | Michael Scherer <misc@mageia.org> | 2012-01-08 20:25:06 +0000 |
commit | 9069208922bd02f233556eb0d2936a9c62d863e0 (patch) | |
tree | da5e5845ce235cb6bbe991adc32978573c2c0342 /deployment | |
parent | 75428aced2ec67b0e69a92c01e6ae2529325c2cf (diff) | |
download | puppet-9069208922bd02f233556eb0d2936a9c62d863e0.tar puppet-9069208922bd02f233556eb0d2936a9c62d863e0.tar.gz puppet-9069208922bd02f233556eb0d2936a9c62d863e0.tar.bz2 puppet-9069208922bd02f233556eb0d2936a9c62d863e0.tar.xz puppet-9069208922bd02f233556eb0d2936a9c62d863e0.zip |
split websites module in smaller pieces
Diffstat (limited to 'deployment')
-rw-r--r-- | deployment/websites/manifests/forum_proxy.pp | 20 | ||||
-rw-r--r-- | deployment/websites/manifests/hugs.pp | 16 | ||||
-rw-r--r-- | deployment/websites/manifests/init.pp | 147 | ||||
-rw-r--r-- | deployment/websites/manifests/pkgcpan.pp | 24 | ||||
-rw-r--r-- | deployment/websites/manifests/releases.pp | 22 | ||||
-rw-r--r-- | deployment/websites/manifests/static.pp | 17 | ||||
-rw-r--r-- | deployment/websites/manifests/svn.pp | 7 | ||||
-rw-r--r-- | deployment/websites/manifests/www.pp | 47 |
8 files changed, 153 insertions, 147 deletions
diff --git a/deployment/websites/manifests/forum_proxy.pp b/deployment/websites/manifests/forum_proxy.pp new file mode 100644 index 00000000..38075893 --- /dev/null +++ b/deployment/websites/manifests/forum_proxy.pp @@ -0,0 +1,20 @@ +class buildsystem { + class forum_proxy { + $web_domain = "forums.$domain" + + host { "$web_domain": + ip => '192.168.122.131', + ensure => 'present', + } + + apache::vhost_reverse_proxy { "$web_domain": + url => "http://$web_domain/", + } + + apache::vhost_reverse_proxy { "ssl_$web_domain": + vhost => $web_domain, + use_ssl => true, + url => "http://$web_domain/", + } + } +} diff --git a/deployment/websites/manifests/hugs.pp b/deployment/websites/manifests/hugs.pp new file mode 100644 index 00000000..628d2b15 --- /dev/null +++ b/deployment/websites/manifests/hugs.pp @@ -0,0 +1,16 @@ +class websites { + class hugs inherits base { + $vhostdir = "$webdatadir/hugs.$domain" + $svn_location = "svn://svn.$domain/svn/web/hugs/public/" + + apache::vhost_base { "hugs.$domain": + location => $vhostdir, + } + + subversion::snapshot { "$vhostdir": + source => $svn_location + } + + package { php-exif: } + } +} diff --git a/deployment/websites/manifests/init.pp b/deployment/websites/manifests/init.pp index 548397d2..5996326b 100644 --- a/deployment/websites/manifests/init.pp +++ b/deployment/websites/manifests/init.pp @@ -2,151 +2,4 @@ class websites { class base { $webdatadir = '/var/www/vhosts' } - - # vhost to host static files used by web sites - class static inherits base { - $vhostdir = "$webdatadir/static.$domain" - $svn_location = "svn://svn.$domain/svn/web/www/trunk/g/" - apache::vhost_other_app { "static.$domain": - vhost_file => 'websites/vhost_static.conf', - } - - file { $vhostdir: - ensure => directory, - mode => 655, - } - - subversion::snapshot { "$vhostdir/g": - source => $svn_location - } - } - - class www inherits base { - include apache::mod_php - include apache::mod_geoip - $vhost = "www.$domain" - $vhostdir = "$webdatadir/www.$domain" - $svn_location = "svn://svn.$domain/svn/web/www/trunk" - - subversion::snapshot { $vhostdir: - source => $svn_location - } - - file { "$vhostdir/var/tmp/cache": - ensure => directory, - owner => root, - group => $apache::base::apache_group, - mode => 0660, - } - - apache::vhost_base { "$vhost": - content => template('websites/vhost_www.conf'), - location => $vhostdir, - options => ['FollowSymLinks'], - } - apache::vhost_base { "ssl_$vhost": - use_ssl => true, - vhost => $vhost, - content => template('websites/vhost_www.conf'), - location => $vhostdir, - options => ['FollowSymLinks'], - } - - apache::vhost_redirect { $domain: - url => 'http://www.mageia.org/', - } - apache::vhost_redirect { "ssl_$domain": - use_ssl => true, - vhost => $domain, - url => 'https://www.mageia.org/', - } - - package { ['php-mbstring', 'php-mcrypt', 'php-gettext']: - ensure => "installed", - } - } - - class hugs inherits base { - $vhostdir = "$webdatadir/hugs.$domain" - $svn_location = "svn://svn.$domain/svn/web/hugs/public/" - apache::vhost_base { "hugs.$domain": - location => $vhostdir, - } - - subversion::snapshot { "$vhostdir": - source => $svn_location - } - - package { php-exif: - ensure => "installed", - } - } - - class releases inherits base { - $vhostdir = "$webdatadir/releases.$domain" - $svn_location = "svn://svn.$domain/svn/web/releases/" - apache::vhost_base { "releases.$domain": - location => $vhostdir, - options => [ "FollowSymLinks" ] - } - apache::vhost_base { "ssl_releases.$domain": - vhost => "releases.$domain", - use_ssl => true, - location => $vhostdir, - options => [ "FollowSymLinks" ] - } - - subversion::snapshot { "$vhostdir": - source => $svn_location - } - } - - class svn { - apache::vhost_redirect { "svn.$domain": - url => "http://svnweb.$domain/", - } - } - - class forum_proxy { - - $web_domain = "forums.$domain" - host { "$web_domain": - ip => '192.168.122.131', - ensure => 'present', - } - - apache::vhost_reverse_proxy { "$web_domain": - url => "http://$web_domain/", - } - - apache::vhost_reverse_proxy { "ssl_$web_domain": - vhost => $web_domain, - use_ssl => true, - url => "http://$web_domain/", - } - } - - class pkgcpan inherits base { - $vhost = "pkgcpan.$domain" - $vhostdir = "$webdatadir/$vhost" - - apache::vhost_base { "$vhost": - location => $vhostdir, - options => [ "Indexes" ] - } - - file { $vhostdir: - ensure => directory, - } - - package { "perl-Module-Packaged-Generator": - ensure => installed, - } - - cron { "update cpanpkg": - hour => 23, - require => Package['perl-Module-Packaged-Generator'], - command => "pkgcpan -q -f $vhostdir/cpan_Mageia.db -d Mageia", - } - } } diff --git a/deployment/websites/manifests/pkgcpan.pp b/deployment/websites/manifests/pkgcpan.pp new file mode 100644 index 00000000..2e306a93 --- /dev/null +++ b/deployment/websites/manifests/pkgcpan.pp @@ -0,0 +1,24 @@ +class websites { + class pkgcpan inherits base { + $vhost = "pkgcpan.$domain" + $vhostdir = "$webdatadir/$vhost" + + apache::vhost_base { "$vhost": + location => $vhostdir, + options => [ "Indexes" ], + } + + file { $vhostdir: + ensure => directory, + } + + package { "perl-Module-Packaged-Generator": } + + # FIXME do not run as root ( apache or nobody should enough ) + cron { "update cpanpkg": + hour => 23, + require => Package['perl-Module-Packaged-Generator'], + command => "pkgcpan -q -f $vhostdir/cpan_Mageia.db -d Mageia", + } + } +} diff --git a/deployment/websites/manifests/releases.pp b/deployment/websites/manifests/releases.pp new file mode 100644 index 00000000..4cb88d67 --- /dev/null +++ b/deployment/websites/manifests/releases.pp @@ -0,0 +1,22 @@ +class websites { + class releases inherits base { + $vhostdir = "$webdatadir/releases.$domain" + $svn_location = "svn://svn.$domain/svn/web/releases/" + + apache::vhost_base { "releases.$domain": + location => $vhostdir, + options => [ "FollowSymLinks" ], + } + + apache::vhost_base { "ssl_releases.$domain": + vhost => "releases.$domain", + use_ssl => true, + location => $vhostdir, + options => [ "FollowSymLinks" ], + } + + subversion::snapshot { "$vhostdir": + source => $svn_location, + } + } +} diff --git a/deployment/websites/manifests/static.pp b/deployment/websites/manifests/static.pp new file mode 100644 index 00000000..0883d779 --- /dev/null +++ b/deployment/websites/manifests/static.pp @@ -0,0 +1,17 @@ +class websites { + class static inherits base { + $vhostdir = "$webdatadir/static.$domain" + + apache::vhost_other_app { "static.$domain": + vhost_file => 'websites/vhost_static.conf', + } + + file { $vhostdir: + ensure => directory, + } + + subversion::snapshot { "$vhostdir/g": + source => "svn://svn.$domain/svn/web/www/trunk/g/", + } + } +} diff --git a/deployment/websites/manifests/svn.pp b/deployment/websites/manifests/svn.pp new file mode 100644 index 00000000..55137872 --- /dev/null +++ b/deployment/websites/manifests/svn.pp @@ -0,0 +1,7 @@ +class websites { + class svn { + apache::vhost_redirect { "svn.$domain": + url => "http://svnweb.$domain/", + } + } +} diff --git a/deployment/websites/manifests/www.pp b/deployment/websites/manifests/www.pp new file mode 100644 index 00000000..63055946 --- /dev/null +++ b/deployment/websites/manifests/www.pp @@ -0,0 +1,47 @@ +class buildsystem { + class www inherits base { + $vhost = "www.$domain" + $vhostdir = "$webdatadir/www.$domain" + $svn_location = "svn://svn.$domain/svn/web/www/trunk" + + include apache::mod_php + include apache::mod_geoip + + subversion::snapshot { $vhostdir: + source => $svn_location, + } + + file { "$vhostdir/var/tmp/cache": + ensure => directory, + owner => root, + group => $apache::base::apache_group, + mode => 0660, + } + + apache::vhost_base { "$vhost": + content => template('websites/vhost_www.conf'), + location => $vhostdir, + options => ['FollowSymLinks'], + } + + apache::vhost_base { "ssl_$vhost": + use_ssl => true, + vhost => $vhost, + content => template('websites/vhost_www.conf'), + location => $vhostdir, + options => ['FollowSymLinks'], + } + + apache::vhost_redirect { $domain: + url => 'http://www.mageia.org/', + } + + apache::vhost_redirect { "ssl_$domain": + use_ssl => true, + vhost => $domain, + url => 'https://www.mageia.org/', + } + + package { ['php-mbstring', 'php-mcrypt', 'php-gettext']: } + } +} |