gocd / go-cookbook

Cookbook that installs and configures the open-source ThoughtWorks Studios GoCD product
http://www.gocd.org/
Apache License 2.0
45 stars 66 forks source link

Allow static definition of server in agent config #62

Closed miroswan closed 8 years ago

miroswan commented 8 years ago

This cookbook appears to assume that there would be only one Go server. If more than one server is found in the search, then it uses the first one found. If I want to allocate a go cd cluster per team, this would be problematic.

Perhaps provide an attribute called node['gocd']['server'] and set to nil, consequently allowing users to set this value. If they don't, then have logic that falls back on existing search logic.

tomzo commented 8 years ago

This is not entirely true.

This cookbook does not support provisioning multiple servers - you'll have to setup those differently. But agents LWRP can have go server host and port specified.

I believe the attribute you would want to have is node['gocd']['agent']['go_server_host'] here

But anyway you don't need an attribute in gocd cookbook. Instead I would recommend using go_agent lwrp like this

gocd_agent 'my-go-agent' do
  go_server_host node[:wrapper_cookbook][:go_server]
  go_server_port 80
  ...
end

@miroswan Let me know if this fits your use case.

miroswan commented 8 years ago

This looks good. I was actually looking at master which looked a little different.