Skip to content

Commit

Permalink
Update service HWRP and recipe.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnbellone committed Feb 9, 2015
1 parent 2ad8e63 commit 14c3bc7
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
6 changes: 0 additions & 6 deletions libraries/provider_consul_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,8 @@ def whyrun_supported?
end

action :create do
consul_client 'consul' do
action :create
end
end

action :delete do
consul_client 'consul' do
action :delete
end
end
end
1 change: 1 addition & 0 deletions libraries/provider_consul_service_sysvinit.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
class Chef::Provider::ConsulServiceSysvinit < Chef::Provider::ConsulService

end
6 changes: 4 additions & 2 deletions libraries/resource_consul_service.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
class Chef::Resource::ConsulService < Chef::Resource::LWRPBase
self.resource_name = :consul_service
actions :create, :delete, :start, :stop, :restart
default_action :create
actions :start, :stop, :restart, :enable, :disable, :reload
default_action :start

attribute :service_name, type: String, name_attribute: true, required: true
end
10 changes: 7 additions & 3 deletions recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,13 @@
group node['consul']['service_group']
end

consul_client File.join(node['consul']['install_dir'], 'consul') do
provider Chef::Provider::ConsulClientBinary if node['consul']['install_method'] == 'binary'
provider Chef::Provider::ConsulClientSource if node['consul']['install_method'] == 'source'
consul_client Chef::Consul.install_path(node) do
filename Chef::Consul.remote_filename(node)
url Chef::Consul.remote_url(node)
checksum Chef::Consul.remote_checksum(node)
version node['consul']['version']
user node['consul']['service_user']
group node['consul']['service_group']
end

consul_service 'consul' do
Expand Down

0 comments on commit 14c3bc7

Please sign in to comment.