Fix scope of vhost template variables

Dynamic scoping for variables in ERB templates was removed in puppet
4[1] which means that the variables defined in the
openstack_health::vhost class cannot be found when it is referenced in
the httpd::vhost defined type and will be evaluated as nil when
puppet runs. Use scope.lookupvar instead to be explicit about the
variable's source.

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

Depends-On: https://review.openstack.org/527302

Change-Id: I19a55d079b236728f1311e130ec6ea851539b446
This commit is contained in:
Colleen Murphy 2018-04-27 20:28:48 +02:00
parent cf611d0b85
commit a791527485
1 changed files with 2 additions and 2 deletions

View File

@ -9,7 +9,7 @@ Listen <%= @vhost_port %>
CustomLog ${APACHE_LOG_DIR}/openstack-health-frontend-access.log combined
ErrorLog ${APACHE_LOG_DIR}/openstack-health-frontend-error.log
<Directory <%= @frontend_dir %>>
<Directory <%= scope.lookupvar('::openstack_health::vhost::frontend_dir') %>>
Order allow,deny
Allow from all
<IfVersion >= 2.4>
@ -17,6 +17,6 @@ Listen <%= @vhost_port %>
</IfVersion>
</Directory>
DocumentRoot <%= @frontend_dir %>
DocumentRoot <%= scope.lookupvar('::openstack_health::vhost::frontend_dir') %>
DirectoryIndex index.html
</VirtualHost>