Alias $name in mailman site for vhost templating

The apache vhost templating is evaluated within the context of an inner
puppet defined resource which overrides the $name value with its own
$name. This means if we want to pass the $name of the outer mailman site
defined resources we need to give it another non overridden name.

In this case we alias $mailman_site_name to $name and use that.

Change-Id: I22e7285161deb7e7945559e0b7a421d244ab1b7a
This commit is contained in:
Clark Boylan 2017-12-22 14:40:21 -08:00 committed by James E. Blair
parent 0778735e66
commit 871e86687f
2 changed files with 5 additions and 1 deletions

View File

@ -69,6 +69,10 @@ define mailman::site ($default_email_host, $default_url_host)
line => "${default_email_host}: /srv/mailman/${name}",
}
# We alias the resource name here so that it can resolve properly
# within the vhost template when evaluated as part of the vhost
# define (which will override $name).
$mailman_site_name = $name
::httpd::vhost { $default_url_host:
port => 80,
docroot => '/var/www/',

View File

@ -34,7 +34,7 @@ Alias /images/mailman/ /usr/share/images/mailman/
AllowOverride None
Options ExecCGI
AddHandler cgi-script .cgi
SetEnv MAILMAN_SITE_DIR /srv/mailman/<%= @name %>
SetEnv MAILMAN_SITE_DIR /srv/mailman/<%= @mailman_site_name %>
Order allow,deny
Allow from all
<IfVersion >= 2.4>