Use httpd::vhost $content parameter
Use the new $content parameter of httpd::vhost instead of $template. This way, the template gets rendered within the scope where it assumes most of its variables are, and doesn't need to use the scope object which doesn't work within a defined type. This will ensure the template keeps working on puppet 4. This also requires adjusting some of the template parameters that had previously been correctly scoped from the httpd::vhost defined type. Depends-On: https://review.openstack.org/570824 Change-Id: I3a45e99e3355d1e59d57d3d989cc03d253529bf2
This commit is contained in:
parent
b44d392811
commit
e40a90fa3e
@ -14,11 +14,16 @@ define meetbot::site(
|
|||||||
$varlib = "/var/lib/meetbot/${name}"
|
$varlib = "/var/lib/meetbot/${name}"
|
||||||
$meetbot = "/srv/meetbot-${name}"
|
$meetbot = "/srv/meetbot-${name}"
|
||||||
|
|
||||||
|
$port = 80
|
||||||
|
$docroot = "/srv/meetbot-${name}"
|
||||||
|
$srvname = $vhost_name
|
||||||
|
$_vhost_name = '*'
|
||||||
|
$options = 'Indexes FollowSymLinks MultiViews'
|
||||||
::httpd::vhost { $vhost_name:
|
::httpd::vhost { $vhost_name:
|
||||||
port => 80,
|
port => 80,
|
||||||
docroot => "/srv/meetbot-${name}",
|
docroot => "/srv/meetbot-${name}",
|
||||||
priority => '50',
|
priority => '50',
|
||||||
template => 'meetbot/vhost.erb',
|
content => template('meetbot/vhost.erb'),
|
||||||
}
|
}
|
||||||
|
|
||||||
file { $varlib:
|
file { $varlib:
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
# Managed by Puppet
|
# Managed by Puppet
|
||||||
# ************************************
|
# ************************************
|
||||||
|
|
||||||
NameVirtualHost <%= @vhost_name %>:<%= @port %>
|
NameVirtualHost <%= @_vhost_name %>:<%= @port %>
|
||||||
<VirtualHost <%= @vhost_name %>:<%= @port %>>
|
<VirtualHost <%= @_vhost_name %>:<%= @port %>>
|
||||||
ServerName <%= @srvname %>
|
ServerName <%= @srvname %>
|
||||||
<% if @serveraliases.is_a? Array -%>
|
<% if @serveraliases.is_a? Array -%>
|
||||||
<% @serveraliases.each do |name| -%><%= " ServerAlias #{name}\n" %><% end -%>
|
<% @serveraliases.each do |name| -%><%= " ServerAlias #{name}\n" %><% end -%>
|
||||||
@ -27,8 +27,8 @@ NameVirtualHost <%= @vhost_name %>:<%= @port %>
|
|||||||
|
|
||||||
<%= @vhost_extra %>
|
<%= @vhost_extra %>
|
||||||
|
|
||||||
ErrorLog /var/log/apache2/<%= @name %>_error.log
|
ErrorLog /var/log/apache2/<%= @srvname %>_error.log
|
||||||
LogLevel warn
|
LogLevel warn
|
||||||
CustomLog /var/log/apache2/<%= @name %>_access.log combined
|
CustomLog /var/log/apache2/<%= @srvname %>_access.log combined
|
||||||
ServerSignature Off
|
ServerSignature Off
|
||||||
</VirtualHost>
|
</VirtualHost>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user