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

Support chef 16 by setting provides on custom resources. Fixes #178. #179

Merged
merged 2 commits into from May 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Expand Up @@ -3,6 +3,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).

This CHANGELOG (now) follows the format listed at [Keep A Changelog](http://keepachangelog.com/)
## [Unreleased]
### Changed
- Chef 16 support. HWRP-style resources now require either the use of `resource_name` or `provides`

### Fixed
- fixes an issue with the install action caused by a missing attribute

Expand Down
2 changes: 2 additions & 0 deletions libraries/resource_docker_source.rb
Expand Up @@ -6,6 +6,8 @@
class Chef
class Resource
class SumoSourceDocker < Chef::Resource::SumoSource
provides :sumo_source_docker if respond_to?(:provides)

attribute :source_type, kind_of: Symbol, required: true, equal_to: %i[docker_stats docker_log]
attribute :uri, kind_of: String, required: true
attribute :specified_containers, kind_of: Array
Expand Down
2 changes: 2 additions & 0 deletions libraries/resource_graphite_metrics_source.rb
Expand Up @@ -6,6 +6,8 @@
class Chef
class Resource
class SumoSourceGraphiteMetrics < Chef::Resource::SumoSource
provides :sumo_source_graphite_metrics if respond_to?(:provides)

attribute :source_type, kind_of: Symbol, default: :graphite, equal_to: [:graphite]
attribute :protocol, kind_of: String, default: 'TCP'
attribute :port, kind_of: Integer, default: 2003
Expand Down
2 changes: 2 additions & 0 deletions libraries/resource_local_file_source.rb
Expand Up @@ -6,6 +6,8 @@
class Chef
class Resource
class SumoSourceLocalFile < Chef::Resource::SumoSource
provides :sumo_source_local_file if respond_to?(:provides)

attribute :source_type, kind_of: Symbol, default: :local_file, equal_to: [:local_file]
attribute :path_expression, kind_of: String, required: true
attribute :blacklist, kind_of: Array
Expand Down
2 changes: 2 additions & 0 deletions libraries/resource_local_win_event_log_source.rb
Expand Up @@ -6,6 +6,8 @@
class Chef
class Resource
class SumoSourceLocalWindowsEventLog < Chef::Resource::SumoSource
provides :sumo_source_local_windows_event_log if respond_to?(:provides)

attribute :source_type, kind_of: Symbol, default: :local_windows_event_log, equal_to: [:local_windows_event_log]
attribute :log_names, kind_of: Array, required: true
end
Expand Down
2 changes: 2 additions & 0 deletions libraries/resource_remote_file_source.rb
Expand Up @@ -6,6 +6,8 @@
class Chef
class Resource
class SumoSourceRemoteFile < Chef::Resource::SumoSource
provides :sumo_source_remote_file if respond_to?(:provides)

attribute :source_type, kind_of: Symbol, default: :remote_file, equal_to: [:remote_file]
attribute :remote_hosts, kind_of: Array, required: true
attribute :remote_port, kind_of: Integer, required: true
Expand Down
2 changes: 2 additions & 0 deletions libraries/resource_remote_win_event_log_source.rb
Expand Up @@ -6,6 +6,8 @@
class Chef
class Resource
class SumoSourceRemoteWindowsEventLog < Chef::Resource::SumoSource
provides :sumo_source_remote_windows_event_log if respond_to?(:provides)

attribute :source_type, kind_of: Symbol, default: :remote_windows_event_log, equal_to: [:remote_windows_event_log]
attribute :domain, kind_of: String, required: true
attribute :username, kind_of: String, required: true
Expand Down
2 changes: 2 additions & 0 deletions libraries/resource_script_source.rb
Expand Up @@ -6,6 +6,8 @@
class Chef
class Resource
class SumoSourceScript < Chef::Resource::SumoSource
provides :sumo_source_script if respond_to?(:provides)

attribute :source_type, kind_of: Symbol, default: :script, equal_to: [:script]
attribute :commands, kind_of: Array, required: true
attribute :file, kind_of: String
Expand Down
2 changes: 2 additions & 0 deletions libraries/resource_source.rb
Expand Up @@ -6,6 +6,8 @@
class Chef
class Resource
class SumoSource < Chef::Resource::LWRPBase
provides :sumo_source if respond_to?(:provides)

default_action :create

actions :create
Expand Down
2 changes: 2 additions & 0 deletions libraries/resource_syslog_source.rb
Expand Up @@ -6,6 +6,8 @@
class Chef
class Resource
class SumoSourceSyslog < Chef::Resource::SumoSource
provides :sumo_source_syslog if respond_to?(:provides)

attribute :source_type, kind_of: Symbol, default: :syslog, equal_to: [:syslog]
attribute :protocol, kind_of: String, default: 'UDP'
attribute :port, kind_of: Integer, default: 514
Expand Down