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
This commit is contained in:
Colleen Murphy 2018-07-24 11:50:15 +02:00
parent b7daee3f9d
commit 14b0bb1606
1 changed files with 1 additions and 1 deletions

View File

@ -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 %>