Skip to content

Commit

Permalink
Merge pull request #1346 from djwhatle/haproxy-separate-ssl
Browse files Browse the repository at this point in the history
HAproxy - keep HTTP and HTTPS separated
  • Loading branch information
djwhatle committed Jan 17, 2017
2 parents 986c336 + e60eb3c commit 1511495
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion server/lib/modules/ose_installer/launch.rb
Expand Up @@ -316,23 +316,33 @@ def update_ha_infra_config(opts)
ha_config_file = "haproxy_infra.cfg"

entries = nil
ssl_entries = nil

counter = 1
opts[:nodes].each do |n|
if counter > 2 # we only want the first 2
break
else
entry = " server infra#{counter} #{n}:443\n server infra#{counter} #{n}:80\n"
entry = " server infra#{counter} #{n}:80\n"
ssl_entry = " server infra_ssl#{counter} #{n}:443\n"
counter += 1

if entries.nil?
entries = entry
else
entries += entry
end

if ssl_entries.nil?
ssl_entries = ssl_entry
else
ssl_entries += ssl_entry
end
end
end

template = template.gsub(/<infras_mirrors>/, entries) if !entries.nil?
template = template.gsub(/<ssl_infras_mirrors>/, ssl_entries) if !ssl_entries.nil?
File.open("#{@output_dir}/#{ha_config_file}", 'w') { |file| file.puts template }
@logger.info "Infra HAProxy configuration file saved at: #{@output_dir}/#{ha_config_file}"
end
Expand Down

0 comments on commit 1511495

Please sign in to comment.