From 9c3c6315732bb1771a32e551dcf162ba439d3fc0 Mon Sep 17 00:00:00 2001 From: Ryan Lane Date: Wed, 5 Dec 2012 19:43:39 -0800 Subject: [PATCH] Set image location explicitly It's ideal for the image location in mediawiki to be outside of its path. This allows you to have multiple copies of the software while having the uploads in a shared spot. Change-Id: Iae0ac3e13213353d6f101c62f5e150cf844b5694 Reviewed-on: https://review.openstack.org/17575 Reviewed-by: Jeremy Stanley Approved: Monty Taylor Reviewed-by: Monty Taylor Tested-by: Jenkins --- modules/mediawiki/manifests/init.pp | 7 ++++--- .../mediawiki/templates/apache/mediawiki.erb | 1 + modules/openstack_project/manifests/wiki.pp | 21 ++++++++++--------- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/modules/mediawiki/manifests/init.pp b/modules/mediawiki/manifests/init.pp index 3e80b33736..99e25a88ff 100644 --- a/modules/mediawiki/manifests/init.pp +++ b/modules/mediawiki/manifests/init.pp @@ -4,12 +4,13 @@ class mediawiki( $role = '', $site_hostname = '', $mediawiki_location = '', + $mediawiki_images_location = '', $ssl_cert_file = "/etc/ssl/certs/${::fqdn}.pem", $ssl_key_file = "/etc/ssl/private/${::fqdn}.key", $ssl_chain_file = '', - $ssl_cert_file_contents = '', # If left empty puppet will not create file. - $ssl_key_file_contents = '', # If left empty puppet will not create file. - $ssl_chain_file_contents = '', # If left empty puppet will not create file. + $ssl_cert_file_contents = '', # If left empty puppet will not create file. + $ssl_key_file_contents = '', # If left empty puppet will not create file. + $ssl_chain_file_contents = '' # If left empty puppet will not create file. ) { if ($role == 'app' or $role == 'all') { diff --git a/modules/mediawiki/templates/apache/mediawiki.erb b/modules/mediawiki/templates/apache/mediawiki.erb index 3d2aaab94e..f89fb71738 100644 --- a/modules/mediawiki/templates/apache/mediawiki.erb +++ b/modules/mediawiki/templates/apache/mediawiki.erb @@ -96,6 +96,7 @@ Alias /w <%= scope.lookupvar('mediawiki::mediawiki_location') %> Alias /wiki <%= scope.lookupvar('mediawiki::mediawiki_location') %>/index.php + Alias /images <%= scope.lookupvar('mediawiki::mediawiki_images_location') %> ErrorLog /var/log/apache2/error.log diff --git a/modules/openstack_project/manifests/wiki.pp b/modules/openstack_project/manifests/wiki.pp index 3ae9eca490..2bbaa88945 100644 --- a/modules/openstack_project/manifests/wiki.pp +++ b/modules/openstack_project/manifests/wiki.pp @@ -5,7 +5,7 @@ class openstack_project::wiki ( $sysadmins = [], $ssl_cert_file_contents = '', $ssl_key_file_contents = '', - $ssl_chain_file_contents = '', + $ssl_chain_file_contents = '' ) { include openssl @@ -21,15 +21,16 @@ class openstack_project::wiki ( ) class { 'mediawiki': - role => 'all', - mediawiki_location => '/srv/mediawiki/w', - site_hostname => $::fqdn, - ssl_cert_file => "/etc/ssl/certs/${::fqdn}.pem", - ssl_key_file => "/etc/ssl/private/${::fqdn}.key", - ssl_chain_file => '/etc/ssl/certs/intermediate.pem', - ssl_cert_file_contents => $ssl_cert_file_contents, - ssl_key_file_contents => $ssl_key_file_contents, - ssl_chain_file_contents => $ssl_chain_file_contents, + role => 'all', + mediawiki_location => '/srv/mediawiki/w', + mediawiki_images_location => '/srv/mediawiki/images', + site_hostname => $::fqdn, + ssl_cert_file => "/etc/ssl/certs/${::fqdn}.pem", + ssl_key_file => "/etc/ssl/private/${::fqdn}.key", + ssl_chain_file => '/etc/ssl/certs/intermediate.pem', + ssl_cert_file_contents => $ssl_cert_file_contents, + ssl_key_file_contents => $ssl_key_file_contents, + ssl_chain_file_contents => $ssl_chain_file_contents, } class { 'memcached': max_memory => 2048,