Fix template variable

Since the chain file contents parameter defaults to undef, on puppet 3
the ERB template evaluates that to the symbol :undef which is not
falsey, so if it is left unset it creates an invalid apache config
pointing to /etc/apache2/undef. To be safe, explicitly check for any
emptyish values. This is only an issue for tests on puppet 3, on puppet
4 undef is correctly evaluated as nil.

Change-Id: I380d69f3928e342562c3c63e35a07555163733e8
This commit is contained in:
Colleen Murphy 2018-07-20 11:15:34 +02:00 committed by Clark Boylan
parent 3f34fa54c6
commit 5870b57528
1 changed files with 1 additions and 1 deletions

View File

@ -16,7 +16,7 @@ NameVirtualHost <%= @vhost_name %>:443
SSLProtocol All -SSLv2 -SSLv3
SSLCertificateFile <%= scope.lookupvar('::drupal::site_ssl_cert_file') %>
SSLCertificateKeyFile <%= scope.lookupvar('::drupal::site_ssl_key_file') %>
<% if scope.lookupvar('::drupal::site_ssl_chain_file_contents') %>
<% if ! ['', nil, :undef].include?(scope.lookupvar('::drupal::site_ssl_chain_file_contents')) %>
SSLCertificateChainFile <%= scope.lookupvar('::drupal::site_ssl_chain_file') %>
<% end %>
<% end %>