2012-10-29 15:20:50 -04:00
|
|
|
# Class: mediawiki
|
|
|
|
#
|
|
|
|
class mediawiki(
|
2012-11-09 16:27:02 -05:00
|
|
|
$role = '',
|
|
|
|
$site_hostname = '',
|
2012-12-18 14:11:43 -08:00
|
|
|
$mediawiki_location = '',
|
2012-12-05 19:43:39 -08:00
|
|
|
$mediawiki_images_location = '',
|
2012-12-18 14:11:43 -08:00
|
|
|
$ssl_cert_file = "/etc/ssl/certs/${::fqdn}.pem",
|
|
|
|
$ssl_key_file = "/etc/ssl/private/${::fqdn}.key",
|
|
|
|
$ssl_chain_file = '',
|
2012-12-05 19:43:39 -08:00
|
|
|
$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.
|
2012-10-29 15:20:50 -04:00
|
|
|
) {
|
2012-11-09 16:27:02 -05:00
|
|
|
|
2012-10-11 11:15:10 -04:00
|
|
|
if ($role == 'app' or $role == 'all') {
|
2012-07-30 00:23:41 -07:00
|
|
|
require apache::dev
|
2012-10-29 15:20:50 -04:00
|
|
|
include apache
|
|
|
|
include mediawiki::php
|
|
|
|
include mediawiki::app
|
2012-07-30 00:23:41 -07:00
|
|
|
|
2013-04-30 18:17:15 -05:00
|
|
|
package { ['libapache2-mod-php5',
|
|
|
|
'lua5.2']:
|
2012-10-29 15:20:50 -04:00
|
|
|
ensure => present,
|
2012-07-30 00:23:41 -07:00
|
|
|
}
|
|
|
|
|
2012-12-18 14:11:43 -08:00
|
|
|
if $ssl_cert_file_contents != '' {
|
|
|
|
file { $ssl_cert_file:
|
|
|
|
owner => 'root',
|
|
|
|
group => 'root',
|
|
|
|
mode => '0640',
|
|
|
|
content => $ssl_cert_file_contents,
|
|
|
|
before => Apache::Vhost[$site_hostname],
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if $ssl_key_file_contents != '' {
|
|
|
|
file { $ssl_key_file:
|
|
|
|
owner => 'root',
|
|
|
|
group => 'ssl-cert',
|
|
|
|
mode => '0640',
|
|
|
|
content => $ssl_key_file_contents,
|
|
|
|
before => Apache::Vhost[$site_hostname],
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if $ssl_chain_file_contents != '' {
|
|
|
|
file { $ssl_chain_file:
|
|
|
|
owner => 'root',
|
|
|
|
group => 'root',
|
|
|
|
mode => '0640',
|
|
|
|
content => $ssl_chain_file_contents,
|
|
|
|
before => Apache::Vhost[$site_hostname],
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-07-30 00:23:41 -07:00
|
|
|
apache::vhost { $site_hostname:
|
2012-10-11 11:15:10 -04:00
|
|
|
port => 443,
|
2014-06-27 15:19:01 -07:00
|
|
|
docroot => '/tmp/meaningless_docroot',
|
2012-07-30 00:23:41 -07:00
|
|
|
priority => '50',
|
|
|
|
template => 'mediawiki/apache/mediawiki.erb',
|
2012-10-11 11:15:10 -04:00
|
|
|
ssl => true,
|
2012-07-30 00:23:41 -07:00
|
|
|
}
|
|
|
|
a2mod { 'rewrite':
|
2012-10-29 15:20:50 -04:00
|
|
|
ensure => present,
|
2012-07-30 00:23:41 -07:00
|
|
|
}
|
|
|
|
a2mod { 'expires':
|
2012-10-29 15:20:50 -04:00
|
|
|
ensure => present,
|
2012-07-30 00:23:41 -07:00
|
|
|
}
|
|
|
|
}
|
2012-10-11 11:15:10 -04:00
|
|
|
if ($role == 'image-scaler' or $role == 'all') {
|
2012-10-29 15:20:50 -04:00
|
|
|
include mediawiki::image_scaler
|
|
|
|
include mediawiki::php
|
|
|
|
include mediawiki::app
|
2012-07-30 00:23:41 -07:00
|
|
|
}
|
|
|
|
}
|
2012-10-29 15:20:50 -04:00
|
|
|
|
|
|
|
# vim:sw=2:ts=2:expandtab:textwidth=79
|