Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create toggle for sync source mode, instead of requiring forking and editing the cookbook #159

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
20 changes: 11 additions & 9 deletions recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down