From 6153eec79547e08d83364f4d35a5a99970a250ef Mon Sep 17 00:00:00 2001 From: Colleen Murphy Date: Fri, 27 Apr 2018 21:24:23 +0200 Subject: [PATCH] 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 manifests 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 Change-Id: I007975c920bd12a352acdea742b841a17ecc5d17 --- templates/storyboard_http.vhost.erb | 2 +- templates/storyboard_https.vhost.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/storyboard_http.vhost.erb b/templates/storyboard_http.vhost.erb index 17e0893..7020bc8 100644 --- a/templates/storyboard_http.vhost.erb +++ b/templates/storyboard_http.vhost.erb @@ -15,7 +15,7 @@ CustomLog ${APACHE_LOG_DIR}/storyboard-access.log combined "> - <% if @new_vhost_perms %> + <% if scope.lookupvar("storyboard::application::new_vhost_perms") %> Require all granted <% else %> Order allow,deny diff --git a/templates/storyboard_https.vhost.erb b/templates/storyboard_https.vhost.erb index 221499c..9e24526 100644 --- a/templates/storyboard_https.vhost.erb +++ b/templates/storyboard_https.vhost.erb @@ -55,7 +55,7 @@ WSGIPassAuthorization On "> - <% if @new_vhost_perms %> + <% if scope.lookupvar("storyboard::application::new_vhost_perms") %> Require all granted <% else %> Order allow,deny