Skip to content

Commit

Permalink
0.4.2: Add support for template from external cookbook; Reload HAProxy
Browse files Browse the repository at this point in the history
* Reload HAproxy if our template changes, since our version of
  consul-template doesn't do that
* Add support for setting `scpr_consul_haproxy.template_cookbook` to specify
  an external template (to support scpr-riakcs)
  • Loading branch information
ewr committed Dec 17, 2015
1 parent 5953e99 commit c5e27e0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
default.scpr_consul_haproxy.timeout_server = "30s"

default.scpr_consul_haproxy.template = "haproxy.consul.erb"
default.scpr_consul_haproxy.template_cookbook = "scpr-consul-haproxy"

default.scpr_consul_haproxy.streammachine_svc_listener = "slave"
default.scpr_consul_haproxy.streammachine_svc_source = "master"
Expand Down
2 changes: 1 addition & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
license 'all_rights'
description 'Installs/Configures scpr-consul-haproxy'
long_description 'Installs/Configures scpr-consul-haproxy'
version '0.4.1'
version '0.4.2'

depends 'apt'
depends 'scpr-consul'
Expand Down
2 changes: 2 additions & 0 deletions recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@
template "/etc/haproxy/haproxy.consul" do
action :create
source node.scpr_consul_haproxy.template
cookbook node.scpr_consul_haproxy.template_cookbook
variables({
config_key: node.scpr_consul_haproxy.config_key,
admin_ip: admin_ip,
})
notifies :reload, "service[consul-template]"
notifies :reload, "service[haproxy]"
end

# Set up our consul template config
Expand Down

0 comments on commit c5e27e0

Please sign in to comment.