Skip to content

Commit 6b0edbb

Browse files
committed
Add port 443 to listen_ports in apache2 (SOC-9172)
This commit stops port clashes between horizon and haproxy on HA deployments with SSL enabled. Without this patch, the apache ssl recipe adds port 443 to the apache listen.conf file without adding the port to the listen_ports array. In a HA setup with ssl enabled, both HAProxy and Apache will try to use port 443. To work around this, the horizon ssl recipe currently checks to see what ports are listed in a listen_ports array, and if either port 443 or port 80 is in there, it wipes the listen.conf file. As port 443 is not currently in the listen_ports array, the horizon recipe leaves the listen.conf file alone in cases where port 443 is in there. This commit adds port 443 to the listen_ports array at the point where it is added as a listen port, so that the horizon recipe can find it later. More explanation in: https://bugzilla.suse.com/show_bug.cgi?id=1141490#c34
1 parent 3c660b4 commit 6b0edbb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

chef/cookbooks/apache2/recipes/mod_ssl.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040
# override the resource defined in default.rb; we don't want to create the
4141
# resource again, otherwise we will write the file twice
4242
resource = resources(template: "#{node[:apache][:dir]}/ports.conf")
43-
resource.variables({apache_listen_ports: [node[:apache][:listen_ports], "443"].flatten})
43+
node[:apache][:listen_ports] << "443"
44+
resource.variables({apache_listen_ports: [node[:apache][:listen_ports]})
4445
end
4546

4647
apache_module "ssl" do

0 commit comments

Comments
 (0)