From 14b0bb16066ad1654d71d921438a161ceccd5b9f Mon Sep 17 00:00:00 2001 From: Colleen Murphy Date: Tue, 24 Jul 2018 11:50:15 +0200 Subject: [PATCH] Fix template variable I forgot that on puppet 3, scope.lookupvar returns :undef instead of nil when it looks up a variable set to 'undef'. Since we're not setting the chain file in our beaker tests, this causes an invalid apache config to be rendered. This patch ensures the file explicitly checks for both nil and :undef. On puppet 4, checking for just nil will be sufficient. Change-Id: I7fd806c65f1aef95618a4549b24c6fa21aa3fe29 --- templates/askbot.vhost.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/askbot.vhost.erb b/templates/askbot.vhost.erb index e4b8b7e..f0fa4e5 100644 --- a/templates/askbot.vhost.erb +++ b/templates/askbot.vhost.erb @@ -21,7 +21,7 @@ NameVirtualHost <%= @vhost_name %>:443 SSLProtocol All -SSLv2 -SSLv3 SSLCertificateFile <%= scope.lookupvar('::askbot::config::site_ssl_cert_file') %> SSLCertificateKeyFile <%= scope.lookupvar('::askbot::config::site_ssl_key_file') %> -<% if scope.lookupvar('::askbot::config::site_ssl_chain_file_contents') != nil %> +<% if ![nil, :undef].include?(scope.lookupvar('::askbot::config::site_ssl_chain_file_contents')) %> SSLCertificateChainFile <%= scope.lookupvar('::askbot::config::site_ssl_chain_file') %> <% end %> <% end %>