From 687dd1519fb0550d5ece8132e89f9daac3b47120 Mon Sep 17 00:00:00 2001 From: Will Salt Date: Thu, 25 Feb 2016 12:44:30 +0000 Subject: [PATCH] added ability to add extra lines to init defaults file --- attributes/agent.rb | 8 +++++--- attributes/server.rb | 1 + templates/default/go-agent-default.erb | 3 +++ templates/default/go-server-default.erb | 3 +++ 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/attributes/agent.rb b/attributes/agent.rb index 941349b..f7592bf 100644 --- a/attributes/agent.rb +++ b/attributes/agent.rb @@ -2,12 +2,14 @@ default['gocd']['agent']['go_server_port'] = 8153 default['gocd']['agent']['daemon'] = true -default['gocd']['agent']['vnc']['enabled'] = false +default['gocd']['agent']['vnc']['enabled'] = false default['gocd']['agent']['autoregister']['key'] = nil default['gocd']['agent']['autoregister']['environments'] = %w() default['gocd']['agent']['autoregister']['resources'] = %w() default['gocd']['agent']['autoregister']['hostname'] = node['fqdn'] + default['gocd']['agent']['server_search_query'] = "chef_environment:#{node.chef_environment} AND recipes:gocd\\:\\:server" -default['gocd']['agent']['workspace'] = nil # '/var/lib/go-agent' on linux -default['gocd']['agent']['count'] = 1 +default['gocd']['agent']['workspace'] = nil # '/var/lib/go-agent' on linux +default['gocd']['agent']['count'] = 1 +default['gocd']['agent']['default_extras'] = {} \ No newline at end of file diff --git a/attributes/server.rb b/attributes/server.rb index 30f35fe..582ab3b 100644 --- a/attributes/server.rb +++ b/attributes/server.rb @@ -7,3 +7,4 @@ default['gocd']['server']['wait_up']['retry_delay'] = 10 default['gocd']['server']['wait_up']['retries'] = 10 +default['gocd']['server']['default_extras'] = {} \ No newline at end of file diff --git a/templates/default/go-agent-default.erb b/templates/default/go-agent-default.erb index 9ef09e4..46cdc1e 100644 --- a/templates/default/go-agent-default.erb +++ b/templates/default/go-agent-default.erb @@ -8,3 +8,6 @@ export JAVA_HOME=<%= node['java']['java_home'] %> export AGENT_WORK_DIR=<%= @workspace %> DAEMON=<%= @daemon ? 'Y' : 'N' %> VNC=<%= @vnc ? 'Y' : 'N' %> +<% node['gocd']['agent']['default_extras'].each do |k, v| %> +<%= k %>="<%= v %>" +<% end %> \ No newline at end of file diff --git a/templates/default/go-server-default.erb b/templates/default/go-server-default.erb index 1da9a67..874af89 100644 --- a/templates/default/go-server-default.erb +++ b/templates/default/go-server-default.erb @@ -15,3 +15,6 @@ export JAVA_HOME=<%= node['java']['java_home'] %> DAEMON=Y ENABLE_PLUGINS=Y +<% node['gocd']['server']['default_extras'].each do |k, v| %> +<%= k %>="<%= v %>" +<% end %> \ No newline at end of file