From 590c0a7202e3da76937f57e4ff06733a283a2822 Mon Sep 17 00:00:00 2001 From: Ryan Gooler Date: Tue, 26 Jun 2018 19:03:23 -0500 Subject: [PATCH 1/4] Create toggle for sync source mode, instead of requiring forking and editing the cookbook --- attributes/default.rb | 3 +++ recipes/default.rb | 20 +++++++++++--------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/attributes/default.rb b/attributes/default.rb index 81679d1d..98ca3e49 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 \ No newline at end of file diff --git a/recipes/default.rb b/recipes/default.rb index 4bd2e7c2..32daf443 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 From 9e50d290408eba88a507ccf845ad76e3f02d2fb6 Mon Sep 17 00:00:00 2001 From: Ryan Gooler Date: Tue, 26 Jun 2018 19:08:19 -0500 Subject: [PATCH 2/4] Create toggle for sync source mode, instead of requiring forking and editing the cookbook --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) 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 From bbf592c11e1458669fb337ed5a87b142cff8244b Mon Sep 17 00:00:00 2001 From: Ryan Gooler Date: Tue, 26 Jun 2018 19:19:26 -0500 Subject: [PATCH 3/4] Fix rubocop whitespace issues --- attributes/default.rb | 3 ++- recipes/default.rb | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/attributes/default.rb b/attributes/default.rb index 98ca3e49..8f28d288 100755 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -167,4 +167,5 @@ 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 \ No newline at end of file +default['sumologic']['already_in_sync_source_mode'] = false + diff --git a/recipes/default.rb b/recipes/default.rb index 32daf443..c73d5f80 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -34,7 +34,7 @@ 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 + # 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 From 1e2e6b24eb1c6002546f147b4c6a17bb260755d5 Mon Sep 17 00:00:00 2001 From: Ryan Gooler Date: Tue, 26 Jun 2018 19:42:20 -0500 Subject: [PATCH 4/4] Fix rubocop whitespace issues part deux --- attributes/default.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/attributes/default.rb b/attributes/default.rb index 8f28d288..79252faa 100755 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -168,4 +168,3 @@ # 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 -