Fix scope of vhost template variable

Dynamic scoping for variables in ERB templates was removed in puppet
4[1], so look up the variables from the scope object.

[1] https://puppet.com/docs/puppet/4.10/lang_updating_manifests.html#dynamic-scoping-in-erb

Change-Id: I1bc639b7cecf9a0ec3b14362e11f645a3c11ddb4
This commit is contained in:
Colleen Murphy 2018-07-15 11:39:12 +02:00
parent cbd5245570
commit 361c38284e
1 changed files with 5 additions and 5 deletions

View File

@ -1,9 +1,9 @@
<% unless [443, 80].include?(@vhost_port.to_i) %>
Listen <%= @vhost_port %>
<% unless [443, 80].include?(scope.lookupvar("::openstack_health::vhost::vhost_port").to_i) %>
Listen <%= scope.lookupvar("::openstack_health::vhost::vhost_port") %>
<% end %>
<VirtualHost *:<%= @vhost_port %>>
ServerName <%= @vhost_name %>
ServerAdmin <%= @serveradmin %>
<VirtualHost *:<%= scope.lookupvar("::openstack_health::vhost::vhost_port") %>>
ServerName <%= scope.lookupvar("::openstack_health::vhost::vhost_name") %>
ServerAdmin <%= scope.lookupvar("::openstack_health::vhost::serveradmin") %>
LogLevel info
CustomLog ${APACHE_LOG_DIR}/openstack-health-frontend-access.log combined