Align all web server usage on apache module.

Change-Id: Idd712a8ee5ec81c6b88b7d3e2270dce4da254927
Reviewed-on: https://review.openstack.org/10838
Approved: Monty Taylor <mordred@inaugust.com>
Reviewed-by: Monty Taylor <mordred@inaugust.com>
Tested-by: Jenkins
This commit is contained in:
Monty Taylor 2012-08-04 13:10:26 -05:00 committed by Jenkins
parent 014b40f2f2
commit 3850c54837
2 changed files with 13 additions and 49 deletions

View File

@ -1,17 +1,19 @@
class mailman($mailman_host='') {
class mailman($vhost_name=$fqdn) {
include apache
package { "mailman":
ensure => installed,
}
package { "apache2":
ensure => installed,
apache::vhost { $vhost_name:
port => 80,
docroot => "/var/www/",
priority => '50',
template => 'mailman/mailman.vhost.erb',
}
file { '/etc/apache2/mods-enabled/rewrite.load':
target => '/etc/apache2/mods-available/rewrite.load',
ensure => link,
require => Package['apache2'],
a2mod { 'rewrite':
ensure => present
}
file { "/var/www/index.html":
@ -34,37 +36,6 @@ class mailman($mailman_host='') {
require => Package["mailman"]
}
file { "/etc/apache2/sites-available/mailman":
content => template('mailman/mailman.vhost.erb'),
owner => 'root',
group => 'root',
ensure => 'present',
replace => 'true',
mode => 444,
require => Package["apache2"],
}
file { "/etc/apache2/sites-enabled/mailman":
ensure => link,
target => '/etc/apache2/sites-available/mailman',
require => [
File['/etc/apache2/sites-available/mailman'],
File['/etc/apache2/mods-enabled/rewrite.load'],
],
}
file { '/etc/apache2/sites-enabled/000-default':
require => File['/etc/apache2/sites-available/mailman'],
ensure => absent,
}
exec { "gracefully restart apache":
subscribe => [ File["/etc/apache2/sites-available/mailman"]],
refreshonly => true,
path => "/bin:/usr/bin:/usr/sbin",
command => "apache2ctl graceful",
}
service { 'mailman':
ensure => running,
hasrestart => true,
@ -73,13 +44,6 @@ class mailman($mailman_host='') {
require => Package["mailman"]
}
service { 'apache2':
ensure => running,
hasrestart => true,
subscribe => File["/etc/apache2/sites-available/mailman"],
require => Package["apache2"]
}
file { '/etc/mailman/en':
owner => 'root',
group => 'list',

View File

@ -1,13 +1,13 @@
<VirtualHost *:80>
ServerName <%= mailman_host %>
ServerName <%= scope.lookupvar("mailman::vhost_name") %>
ErrorLog ${APACHE_LOG_DIR}/mailman-error.log
ErrorLog ${APACHE_LOG_DIR}/<%= scope.lookupvar("mailman::vhost_name") %>-error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/mailman-access.log combined
CustomLog ${APACHE_LOG_DIR}/<%= scope.lookupvar("mailman::vhost_name") %>-access.log combined
DocumentRoot /var/www