From 4ef66c2bee40f00d475375cad6b9cb6003fc324a Mon Sep 17 00:00:00 2001 From: Colleen Murphy Date: Wed, 12 Sep 2018 18:40:50 +0200 Subject: [PATCH] Fix undef in vhost templates On puppet 3 an explicit undef value is evaluated as the symbol :undef in ERB templates, while on puppet 4 the explicit undef is evaluated the same as the implicit undef which comes to the nil value in ERB. Check for both values to make both puppet versions happy. Change-Id: Ib4bff7259fea2722f799745d476d1af0c34408d5 --- 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 524adad..951bf83 100644 --- a/templates/storyboard_http.vhost.erb +++ b/templates/storyboard_http.vhost.erb @@ -1,5 +1,5 @@ -<% if scope.lookupvar("storyboard::application::server_admin") != :undef %> +<% if ! [nil, :undef].include?(scope.lookupvar("storyboard::application::server_admin")) %> ServerAdmin <%= scope.lookupvar("storyboard::application::server_admin") %> <% end %> ServerName <%= scope.lookupvar("storyboard::application::hostname") %> diff --git a/templates/storyboard_https.vhost.erb b/templates/storyboard_https.vhost.erb index 15ce048..2f05e08 100644 --- a/templates/storyboard_https.vhost.erb +++ b/templates/storyboard_https.vhost.erb @@ -1,5 +1,5 @@ -<% if scope.lookupvar("storyboard::application::server_admin") != :undef %> +<% if ! [nil, :undef].include?(scope.lookupvar("storyboard::application::server_admin")) %> ServerAdmin <%= scope.lookupvar("storyboard::application::server_admin") %> <% end %> ServerName <%= scope.lookupvar("storyboard::application::hostname") %>