Skip to content

Commit

Permalink
allow overriding the init subsystem.
Browse files Browse the repository at this point in the history
relates to #141

We now allow using `node['sumologic']['init_style']` with any valid chef provider. Default is `nil` and will defer to ohai unless overridden.

Note: it does not attempt an validation that you chose a valid provider.

Signed-off-by: Ben Abrams <[email protected]>
  • Loading branch information
majormoses committed Sep 11, 2017
1 parent 96af5f1 commit 62f3e29
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
5 changes: 1 addition & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ This CHANGELOG (now) follows the format listed at [Keep A Changelog](http://keep

## [Unreleased]
### Added
- TBD

### Changed
- TBD
- the ability to use `node['sumologic']['init_style']` to specify an override for an init subsystem while keeping the same defaults of delegating that to ohai detection.

## [1.2.22] - 2017-08-15
### Added
Expand Down
11 changes: 11 additions & 0 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -154,3 +154,14 @@
end

default['sumologic']['chef_vault_version'] = nil

# if left nil it will defer to ohai to determine, you can
# change the behavior to use a specific init style as long
# as the collector and chef supports it. Consult the chef
# documentation here: https://docs.chef.io/resource_service.html
# for a list of acceptable options. Some examples:
# `Chef::Provider::Service::Systemd`, `Chef::Provider::Service::Upstart`,
# `Chef::Provider::Service::Init::Debian`, etc. Here is
# the source of trusth on supported init subsystemds:
# https://github.com/chef/chef/tree/v13.4.19/lib/chef/provider/service
default['sumologic']['init_style'] = nil
2 changes: 2 additions & 0 deletions recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@
when 'rhel', 'amazon', 'linux', 'debian'
service 'collector' do
action :start
provider node['sumologic']['init_style'] unless node['sumologic']['init_style'].nil?
end
else
service 'sumo-collector' do
action :start
provider node['sumologic']['init_style'] unless node['sumologic']['init_style'].nil?
end
end

Expand Down

0 comments on commit 62f3e29

Please sign in to comment.