diff options
Diffstat (limited to 'deployment/websites/manifests/www.pp')
| -rw-r--r-- | deployment/websites/manifests/www.pp | 111 |
1 files changed, 62 insertions, 49 deletions
diff --git a/deployment/websites/manifests/www.pp b/deployment/websites/manifests/www.pp index b42d4c2c..08c232f2 100644 --- a/deployment/websites/manifests/www.pp +++ b/deployment/websites/manifests/www.pp @@ -1,51 +1,64 @@ -class websites { - 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 - - # for mailman reverse proxy, on ssl - include apache::mod_proxy - include apache::mod_ssl - - 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', "websites/vhost_proxy_mailman.conf"), - location => $vhostdir, - options => ['FollowSymLinks'], - } - - apache::vhost_base { "ssl_$vhost": - use_ssl => true, - vhost => $vhost, - content => template('websites/vhost_www.conf', "websites/vhost_proxy_mailman_ssl.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', 'php-geoip']: } +class websites::www { + include websites::base + $vhost = "www.${::domain}" + $vhostdir = "${websites::base::webdatadir}/${vhost}" + $git_location = "git://git.${::domain}/web/www" + + include apache::var + include apache::mod::php + + # for mailman reverse proxy, on ssl + include apache::mod::proxy + include apache::mod::ssl + + git::snapshot { $vhostdir: + source => $git_location, + } + + file { [ "${vhostdir}/var", + "${vhostdir}/var/tmp", + "${vhostdir}/var/tmp/cache" ] : + ensure => directory, + group => $apache::var::apache_group, + mode => '0660', + require => Git::Snapshot[$vhostdir], + } + + file { [ "${vhostdir}/_nav", + "${vhostdir}/_nav/var", + "${vhostdir}/_nav/var/tmp", + "${vhostdir}/_nav/var/tmp/cache" ] : + ensure => directory, + group => $apache::var::apache_group, + mode => '0660', + require => Git::Snapshot[$vhostdir], + } + + apache::vhost::base { $vhost: + content => template('websites/vhost_www.conf', + 'websites/vhost_www_rewrite.conf'), + location => $vhostdir, + options => ['FollowSymLinks'], + } + + apache::vhost::base { "ssl_${vhost}": + use_ssl => true, + vhost => $vhost, + content => template('websites/vhost_www.conf', + 'websites/vhost_www_rewrite.conf'), + location => $vhostdir, + options => ['FollowSymLinks'], + } + + apache::vhost_redirect { "${::domain}": + url => "https://www.${::domain}/", + } + + apache::vhost_redirect { "ssl_${::domain}": + use_ssl => true, + vhost => "${::domain}", + url => "https://www.${::domain}/", } + + package { ['php-mbstring', 'php-mcrypt', 'php-gettext']: } } |
