From c2b2b6f08b8854b4ceb495df070c12c5c0ebc8d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Kar=C3=A9kinian?= Date: Mon, 17 Feb 2020 15:04:08 +0100 Subject: [PATCH] Fix the vhost template hosts must be defined in the main config file --- site-cookbooks/kosmos-ejabberd/templates/ejabberd.yml.erb | 5 +++++ site-cookbooks/kosmos-ejabberd/templates/vhost.yml.erb | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/site-cookbooks/kosmos-ejabberd/templates/ejabberd.yml.erb b/site-cookbooks/kosmos-ejabberd/templates/ejabberd.yml.erb index a78f3a1..fc4cbe5 100644 --- a/site-cookbooks/kosmos-ejabberd/templates/ejabberd.yml.erb +++ b/site-cookbooks/kosmos-ejabberd/templates/ejabberd.yml.erb @@ -6,6 +6,11 @@ log_rotate_count: 1 log_rate_limit: 100 +hosts: +<% @hosts.each do |host| -%> + - "<%= host[:name] %>" +<% end -%> + <% @hosts.each do |host| -%> include_config_file: "/opt/ejabberd/conf/<%= host[:name] %>.yml" <% end -%> diff --git a/site-cookbooks/kosmos-ejabberd/templates/vhost.yml.erb b/site-cookbooks/kosmos-ejabberd/templates/vhost.yml.erb index 616d71e..875af76 100644 --- a/site-cookbooks/kosmos-ejabberd/templates/vhost.yml.erb +++ b/site-cookbooks/kosmos-ejabberd/templates/vhost.yml.erb @@ -1,7 +1,4 @@ # Generated by Chef for <%= @host[:name] %> -hosts: - - "<%= @host[:name] %>" - <% if File.exist?("/opt/ejabberd/conf/#{@host[:name]}.crt") && File.exist?("/opt/ejabberd/conf/#{@host[:name]}.key") -%> certfiles: - "/opt/ejabberd/conf/<%= @host[:name] %>.crt"