system-config/modules/mediawiki/manifests/init.pp
James E. Blair 37daa678e2 Add ssl cert to wiki.o.o.
Change-Id: I6c6ad0ddd000e3f140cb08faef7dce2cb9ae7079
Reviewed-on: https://review.openstack.org/18349
Reviewed-by: Ryan Lane
Reviewed-by: Monty Taylor <mordred@inaugust.com>
Approved: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Tested-by: Jenkins
2012-12-18 23:00:55 +00:00

77 lines
1.9 KiB
Puppet

# Class: mediawiki
#
class mediawiki(
$role = '',
$site_hostname = '',
$mediawiki_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.
) {
if ($role == 'app' or $role == 'all') {
require apache::dev
include apache
include mediawiki::php
include mediawiki::app
package { 'libapache2-mod-php5':
ensure => present,
}
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],
}
}
apache::vhost { $site_hostname:
port => 443,
docroot => 'MEANINGLESS ARGUMENT',
priority => '50',
template => 'mediawiki/apache/mediawiki.erb',
ssl => true,
}
a2mod { 'rewrite':
ensure => present,
}
a2mod { 'expires':
ensure => present,
}
}
if ($role == 'image-scaler' or $role == 'all') {
include mediawiki::image_scaler
include mediawiki::php
include mediawiki::app
}
}
# vim:sw=2:ts=2:expandtab:textwidth=79