From 5870b57528ac5930923fd9cffe056c018bac2d56 Mon Sep 17 00:00:00 2001 From: Colleen Murphy Date: Fri, 20 Jul 2018 11:15:34 +0200 Subject: [PATCH] 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 --- templates/drupal.vhost.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/drupal.vhost.erb b/templates/drupal.vhost.erb index e84d2bd..28e940e 100644 --- a/templates/drupal.vhost.erb +++ b/templates/drupal.vhost.erb @@ -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 %>