Skip to content

Commit

Permalink
Fix socket path for haproxy. Use default path for RHEL 7.1.
Browse files Browse the repository at this point in the history
Because of SELinux haproxy is not allowed to use the socket in /tmp.
  • Loading branch information
workeitel committed Jun 10, 2015
1 parent 12a0136 commit 6784b4d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion haproxy/attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,14 @@
default[:haproxy][:retries] = '3'
default[:haproxy][:httpclose] = true
default[:haproxy][:http_server_close] = false
default[:haproxy][:stats_socket_path] = '/tmp/haproxy.sock'

if node[:platform] == "redhat" && Chef::VersionConstraint.new("~> 7.0").include?(node["platform_version"])
default[:haproxy][:stats_socket_path] = "/var/lib/haproxy/stats"
else
default[:haproxy][:stats_socket_path] = '/tmp/haproxy.sock'
end


default[:haproxy][:stats_socket_level] = nil # nil for default or 'user', 'operator', 'admin'

# load factors for maxcon
Expand Down

0 comments on commit 6784b4d

Please sign in to comment.