diff --git a/modules/mailman/files/apache.conf b/modules/mailman/files/apache.conf
deleted file mode 100644
index a7f421cc5f..0000000000
--- a/modules/mailman/files/apache.conf
+++ /dev/null
@@ -1,73 +0,0 @@
-# Sample configuration for Debian mailman with Apache
-
-# We can find mailman here:
-ScriptAlias /cgi-bin/mailman/ /usr/lib/cgi-bin/mailman/
-# And the public archives:
-Alias /pipermail/ /var/lib/mailman/archives/public/
-# Logos:
-Alias /images/mailman/ /usr/share/images/mailman/
-
-# Use this if you don't want the "cgi-bin" component in your URL:
-# In case you want to access mailman through a shorter URL you should enable
-# this:
-#ScriptAlias /mailman/ /usr/lib/cgi-bin/mailman/
-# In this case you need to set the DEFAULT_URL_PATTERN in
-# /etc/mailman/mm_cfg.py to http://%s/mailman/ for the cookie
-# authentication code to work. Note that you need to change the base
-# URL for all the already-created lists as well.
-
-
This is the default web page for this server.
+The web server software is running but no content has been added, yet.
+ diff --git a/modules/mailman/manifests/init.pp b/modules/mailman/manifests/init.pp index 42b161d7f9..4fa1f1c3c6 100644 --- a/modules/mailman/manifests/init.pp +++ b/modules/mailman/manifests/init.pp @@ -8,6 +8,16 @@ class mailman($mailman_host='') { ensure => installed, } + file { "/var/www/index.html": + source => 'puppet:///modules/mailman/index.html', + owner => 'root', + group => 'root', + ensure => 'present', + replace => 'true', + mode => 444, + require => Package["apache2"], + } + file { '/etc/mailman/mm_cfg.py': owner => 'root', group => 'root', @@ -18,14 +28,34 @@ class mailman($mailman_host='') { require => Package["mailman"] } - file { '/etc/mailman/apache.conf': + file { "/etc/apache2/sites-available/mailman": + content => template('mailman/mailman.vhost.erb'), owner => 'root', group => 'root', - mode => 444, ensure => 'present', - source => 'puppet:///modules/mailman/apache.conf', replace => 'true', - require => Package["mailman"] + 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/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': @@ -38,7 +68,7 @@ class mailman($mailman_host='') { service { 'apache2': ensure => running, hasrestart => true, - subscribe => File['/etc/mailman/apache.conf'], + subscribe => File["/etc/apache2/sites-available/mailman"], require => Package["apache2"] } } diff --git a/modules/mailman/templates/mailman.vhost.erb b/modules/mailman/templates/mailman.vhost.erb new file mode 100644 index 0000000000..5d06ae376d --- /dev/null +++ b/modules/mailman/templates/mailman.vhost.erb @@ -0,0 +1,49 @@ +