Skip to content

Commit

Permalink
Allow custom init scripts
Browse files Browse the repository at this point in the history
Allow override of init script cookbook and filename.

RE: #321.
Closes #354.
Fixes #353.
  • Loading branch information
martinb3 committed Sep 15, 2015
1 parent 792f340 commit 2e8ec3e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libraries/provider_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class Provider::ElasticsearchService < Chef::Provider::LWRPBase
# Create service
#
init_r = template "/etc/init.d/#{new_resource.service_name}" do
source "elasticsearch.init.erb"
cookbook 'elasticsearch'
source new_resource.init_source
cookbook new_resource.init_cookbook
owner 'root'
mode 0755
variables({
Expand Down
4 changes: 4 additions & 0 deletions libraries/resource_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,9 @@ class Resource::ElasticsearchService < Chef::Resource::LWRPBase

# service actions
attribute(:service_actions, kind_of: [Symbol, Array], default: [ :enable ])

# allow overridable init script
attribute(:init_source, kind_of: String, default: 'elasticsearch.init.erb')
attribute(:init_cookbook, kind_of: String, default: 'elasticsearch')
end
end

0 comments on commit 2e8ec3e

Please sign in to comment.