Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions chef/cookbooks/horizon/recipes/ha.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,32 @@

include_recipe "crowbar-pacemaker::haproxy"

stick_options = {
# we want stickiness for the session (sessionid), but also for the login form
# (csrftoken)
cookies: ["sessionid", "csrftoken"],
expire: "#{node[:horizon][:session_timeout]}m"
}

haproxy_loadbalancer "horizon" do
address "0.0.0.0"
port 80
use_ssl false
servers CrowbarPacemakerHelper.haproxy_servers_for_service(node, "horizon", "horizon-server", "plain")
stick stick_options
action :nothing
end.run_action(:create)

if node[:horizon][:apache][:ssl]
stick_options = { expire: "#{node[:horizon][:session_timeout]}m" }

haproxy_loadbalancer "horizon-ssl" do
address "0.0.0.0"
port 443
use_ssl true
servers CrowbarPacemakerHelper.haproxy_servers_for_service(node, "horizon", "horizon-server", "ssl")
stick stick_options
balance "source"
action :nothing
end.run_action(:create)
end
Expand Down