Skip to content

Commit

Permalink
use flag rather than env var for consul reload
Browse files Browse the repository at this point in the history
  • Loading branch information
Morgan Delagrange committed Aug 24, 2015
1 parent 153a25d commit cba89ed
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
5 changes: 1 addition & 4 deletions manifests/reload_service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@
if $consul::manage_service == true and $consul::service_ensure == 'running' {
exec { 'reload consul service':
path => [$consul::bin_dir,'/bin','/usr/bin'],
command => 'consul reload',
environment => [
"CONSUL_RPC_ADDR=${consul::rpc_addr}:${consul::rpc_port}",
],
command => "consul reload -rpc-addr=${consul::rpc_addr}:${consul::rpc_port}",
refreshonly => true,
}
}
Expand Down
19 changes: 17 additions & 2 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@
}}
it {
should contain_exec('reload consul service').
with_environment(['CONSUL_RPC_ADDR=127.0.0.1:8400'])
with_command('consul reload -rpc-addr=127.0.0.1:8400')
}
end

Expand All @@ -373,7 +373,22 @@
}}
it {
should contain_exec('reload consul service').
with_environment(['CONSUL_RPC_ADDR=consul.example.com:9999'])
with_command('consul reload -rpc-addr=consul.example.com:9999')
}
end

context "When consul is reloaded with a default client_addr" do
let (:params) {{
:services => {
'test_service1' => {}
},
:config_hash => {
'client_addr' => '192.168.34.56',
}
}}
it {
should contain_exec('reload consul service').
with_command('consul reload -rpc-addr=192.168.34.56:8400')
}
end

Expand Down

0 comments on commit cba89ed

Please sign in to comment.