Commit 996b3441 authored by Ben Abrams's avatar Ben Abrams
Browse files

allow overriding the init subsystem.



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: default avatarBen Abrams <me@benabrams.it>
parent 96af5f16
......@@ -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
......
......@@ -154,3 +154,14 @@ else
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
......@@ -44,10 +44,12 @@ if File.exist? node['sumologic']['installDir']
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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment