diff --git a/CHANGELOG.md b/CHANGELOG.md index 725a73ea..7b975159 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ This project adheres to [Semantic Versioning](http://semver.org/). This CHANGELOG (now) follows the format listed at [Keep A Changelog](http://keepachangelog.com/) ## [Unreleased] +### Added +- Added `aready_in_sync_source_mode` property to remove need to fork and edit cookbook. ## [1.4.0] - 2018-06-26 ### Added diff --git a/attributes/default.rb b/attributes/default.rb index 81679d1d..79252faa 100755 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -165,3 +165,6 @@ # 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 + +# Toggle to enable some helpful logic if the system is already set up in sync source mode +default['sumologic']['already_in_sync_source_mode'] = false diff --git a/recipes/default.rb b/recipes/default.rb index 4bd2e7c2..c73d5f80 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -31,15 +31,17 @@ if File.exist? node['sumologic']['installDir'] Chef::Log.info "Sumo Logic Collector found." # If collector is already in sync source mode, just uncomment these following lines to update the sources - # include_recipe 'sumologic-collector::sumoconf' - # if node['sumologic']['use_json_path_dir'] == true - # # use the recipe sumojsondir if your source configurations are in a directory - # include_recipe 'sumologic-collector::sumojsondir' - # else - # # use the recipe sumojson if your source configurations are in a single json file - # include_recipe 'sumologic-collector::sumojson' - # end - # include_recipe 'sumologic-collector::restart' + if node['sumologic']['already_in_sync_source_mode'] == true + include_recipe 'sumologic-collector::sumoconf' + if node['sumologic']['use_json_path_dir'] == true + # use the recipe sumojsondir if your source configurations are in a directory + include_recipe 'sumologic-collector::sumojsondir' + else + # use the recipe sumojson if your source configurations are in a single json file + include_recipe 'sumologic-collector::sumojson' + end + include_recipe 'sumologic-collector::restart' + end case node['platform_family'] when 'rhel', 'amazon', 'linux', 'debian' service 'collector' do