From 0be63e59357fc0f64cdfd5073641bc9936194cc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Kar=C3=A9kinian?= Date: Tue, 14 May 2019 11:31:42 +0200 Subject: [PATCH] Fix the config file when no TLS certs exist --- .../kosmos-ejabberd/templates/ejabberd.yml.erb | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/site-cookbooks/kosmos-ejabberd/templates/ejabberd.yml.erb b/site-cookbooks/kosmos-ejabberd/templates/ejabberd.yml.erb index 2632bdb..7671a07 100644 --- a/site-cookbooks/kosmos-ejabberd/templates/ejabberd.yml.erb +++ b/site-cookbooks/kosmos-ejabberd/templates/ejabberd.yml.erb @@ -24,19 +24,18 @@ host_config: sql_username: "ejabberd" sql_password: "<%= @pgsql_password %>" +<% if (File.exist?("/opt/ejabberd/conf/kosmos.org.crt") && File.exist?("/opt/ejabberd/conf/kosmos.org.key")) || + (File.exist?("/opt/ejabberd/conf/5apps.com.crt") && File.exist?("/opt/ejabberd/conf/5apps.com.key")) -%> certfiles: -<% if File.exist?("/opt/ejabberd/conf/kosmos.org.crt") -%> +<% if File.exist?("/opt/ejabberd/conf/kosmos.org.crt") && File.exist?("/opt/ejabberd/conf/kosmos.org.key") -%> - "/opt/ejabberd/conf/kosmos.org.crt" -<% end -%> -<% if File.exist?("/opt/ejabberd/conf/kosmos.org.key") -%> - "/opt/ejabberd/conf/kosmos.org.key" <% end -%> -<% if File.exist?("/opt/ejabberd/conf/5apps.com.crt") -%> +<% if File.exist?("/opt/ejabberd/conf/5apps.com.crt") && File.exist?("/opt/ejabberd/conf/5apps.com.key") -%> - "/opt/ejabberd/conf/5apps.com.crt" -<% end -%> -<% if File.exist?("/opt/ejabberd/conf/5apps.com.key") -%> - "/opt/ejabberd/conf/5apps.com.key" <% end -%> +<% end -%> ca_file: "/opt/ejabberd/conf/cacert.pem"