-
-
Notifications
You must be signed in to change notification settings - Fork 248
Description
As of now the haproxy/members
attribute adds the following 2 entries by default to the servers-http
backend.
https://github.com/hw-cookbooks/haproxy/blob/master/attributes/default.rb#L26-L36
https://github.com/hw-cookbooks/haproxy/blob/master/recipes/default.rb#L57-L64
This haproxy/members
can be made more helpful if we can hash the members based on backend names
node.set['haproxy']['members']['servers-http'] = [{
...
}]
This would make this attribute more helpful when we want to create additional backend sections with their own list of servers attached.
node.set['haproxy']['members']['new_backend'] = [{
...
}]
It would also be helpful to have a helper method that does this - https://github.com/hw-cookbooks/haproxy/blob/master/recipes/default.rb#L57-L59
We can probably have a options hash to set these values to the server entry - weight #{member['weight'] || member_weight} maxconn #{member['max_connections'] || member_max_conn} check"
options = {
weight: member['weight'] || member_weight
maxconn: member['max_connections'] || member_max_conn
check: true
}
Wasn't this the purpose of having a haproxy/members
attribute? Or I am going in the wrong direction?