5f58803b8d
The name of the apache package and service are different on different operating systems. Fortunately, the apache module populates a variable with the correct name for us. This is also true of the apache ssl package. Change-Id: I7d93e56281f828cba9262c135b0beb43dce9748a
59 lines
1.2 KiB
Puppet
59 lines
1.2 KiB
Puppet
# == Class: mailman
|
|
#
|
|
class mailman($vhost_name=$::fqdn) {
|
|
|
|
include apache
|
|
|
|
package { 'mailman':
|
|
ensure => installed,
|
|
}
|
|
|
|
apache::vhost { $vhost_name:
|
|
port => 80,
|
|
docroot => '/var/www/',
|
|
priority => '50',
|
|
template => 'mailman/mailman.vhost.erb',
|
|
}
|
|
a2mod { 'rewrite':
|
|
ensure => present,
|
|
}
|
|
|
|
file { '/var/www/index.html':
|
|
ensure => present,
|
|
source => 'puppet:///modules/mailman/index.html',
|
|
owner => 'root',
|
|
group => 'root',
|
|
replace => true,
|
|
mode => '0444',
|
|
require => Package[$::apache::params::apache_name],
|
|
}
|
|
|
|
file { '/etc/mailman/mm_cfg.py':
|
|
ensure => present,
|
|
owner => 'root',
|
|
group => 'root',
|
|
mode => '0444',
|
|
content => template('mailman/mm_cfg.py.erb'),
|
|
replace => true,
|
|
require => Package['mailman'],
|
|
}
|
|
|
|
service { 'mailman':
|
|
ensure => running,
|
|
hasrestart => true,
|
|
hasstatus => false,
|
|
subscribe => File['/etc/mailman/mm_cfg.py'],
|
|
require => Package['mailman'],
|
|
}
|
|
|
|
file { '/etc/mailman/en':
|
|
ensure => directory,
|
|
owner => 'root',
|
|
group => 'list',
|
|
mode => '0644',
|
|
recurse => true,
|
|
require => Package['mailman'],
|
|
source => 'puppet:///modules/mailman/html-templates-en',
|
|
}
|
|
}
|