Commit e5f07abd authored by Jonathan Hartman's avatar Jonathan Hartman Committed by Ben Abrams
Browse files

Add support for additional resource-configured collector attributes

Most of these were added relatively recently, with v19.182.
parent 0b39682f
......@@ -13,6 +13,7 @@ TBD
## [1.2.23] - 2017-10-12
### Added
- 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.
- Support setting a resource-configured collector's `hostName`, `description`, `category`, `disableActionSource`, `disableUpgrade`, `timeZone`, and `targetCPU`.
## [1.2.22] - 2017-08-15
### Added
......
......@@ -185,6 +185,9 @@ for more information about these attributes.
| `source` | `String` | URL to download collector installer from | none (uses the latest installer from SumoLogic) | `false` | `:install`, `:install_and_configure` |
| `collector_name` | `String` | Name of this Collector | `nil` | `false` | `:install_and_configure`, `:configure` |
| `collector_url` | `String` | URL used to register Collector for data collection API | `nil` | `false` | `:install_and_configure`, `:configure` |
| `host_name` | `String` | Hostname of this collector + default hostname of sources on it | `nil` | `false` | `:install_and_configure`, `:configure` |
| `description` | `String` | Description of this collector | `nil` | `false` | `:install_and_configure`, `:configure` |
| `category` | `String` | Default category for sources on this collector | `nil` | `false` | `:install_and_configure`, `:configure` |
| `sumo_token_and_url` | `String` | Encoded Setup Wizard token | `nil` | `false` | `:install_and_configure` |
| `sumo_access_id` | `String` | Access ID used when logging in with Access ID and Key | `nil` | `false` | `:install_and_configure`, `:configure` |
| `sumo_access_key` | `String` | Access Key used when logging in with Access ID and Key | `nil` | `false` | `:install_and_configure`, `:configure` |
......@@ -198,8 +201,12 @@ for more information about these attributes.
| `ephemeral` | `Boolean` | When `true`, the Collector will be deleted after goes offline for a certain period of time | `false` | `false` | `:install_and_configure`, `:configure` |
| `clobber` | `Boolean` | When `true`, if there is any existing Collector with the same name, that Collector will be deleted | `false` | `false` | `:install_and_configure`, `:configure` |
| `disable_script_source` | `Boolean` | If your organization's internal policies restrict the use of scripts, you can disable the creation of script-based Script Sources. When this parameter is passed, this option is removed from the Sumo Logic Web Application, and Script Source cannot be configured | `false` | `false` | `:install_and_configure`, `:configure` |
| `wrapper_java_initmemory | `Integer` | Override the initial Java heap size | `nil` | `false` | `:configure |
| `wrapper_java_maxmemory | `Integer` | Override the maximum Java heap size | `nil` | `false` | `:configure |
| `disable_action_source` | `Boolean` | If your organization's internal policies restrict the use of script actions, you can disable the creation of script-based action sources. When this parameter is passed, action sources will not execute on this collector. | `false` | `false` | `:install_and_configure`, `:configure` |
| `disable_upgrade` | `Boolean` | If true, the collector rejects upgrade requests from Sumo. | `false` | `false` | `:install_and_configure`, `:configure` |
| `time_zone` | `String` | The default time zone for sources on this collector | `nil` | `false` | `:install_and_configure`, `:configure` |
| `target_cpu` | `Integer` | Target to which to limit the CPU usage of this collector | `nil` | `false` | `:install_and_configure`, `:configure` |
| `wrapper_java_initmemory` | `Integer` | Override the initial Java heap size | `nil` | `false` | `:configure` |
| `wrapper_java_maxmemory` | `Integer` | Override the maximum Java heap size | `nil` | `false` | `:configure` |
| `runas_username` | `String` | Which user the daemon will run as | `nil` | `false` | `:install_and_configure`, `:install` |
| `winrunas_password` | `String` | On Windows, the password for the user the service will run as | `nil` | `false` | `:install_and_configure`, `:install` |
| `skip_registration` | `Boolean` | When `true` the collector will not register upon installation | `false` | `nil` | `:install_and_configure` |
......
......@@ -9,7 +9,7 @@ actions :install, :install_and_configure, :configure, :remove, :start, :stop, :r
# Installation attributes
attribute :dir, kind_of: String, name_attribute: true
attribute :source, kind_of: String
attribute :source, kind_of: String, default: nil
attribute :runas_username, kind_of: String, default: nil
attribute :winrunas_password, kind_of: String, default: nil
attribute :skip_registration, kind_of: [TrueClass, FalseClass], default: false
......@@ -17,6 +17,9 @@ attribute :skip_registration, kind_of: [TrueClass, FalseClass], default: false
# Configuration attributes
attribute :collector_name, kind_of: String, default: nil
attribute :collector_url, kind_of: String, default: nil
attribute :host_name, kind_of: String, default: nil
attribute :description, kind_of: String, default: nil
attribute :category, kind_of: String, default: nil
attribute :service_retries, kind_of: Integer, default: 0
attribute :service_retry_delay, kind_of: Integer, default: 2
attribute :sumo_token_and_url, kind_of: String, default: nil
......@@ -32,8 +35,12 @@ attribute :sync_sources, kind_of: String, default: nil
attribute :ephemeral, kind_of: [TrueClass, FalseClass], default: false
attribute :clobber, kind_of: [TrueClass, FalseClass], default: false
attribute :disable_script_source, kind_of: [TrueClass, FalseClass], default: false
attribute :wrapper_java_initmemory, kind_of: Integer
attribute :wrapper_java_maxmemory, kind_of: Integer
attribute :disable_action_source, kind_of: [TrueClass, FalseClass], default: false
attribute :disable_upgrade, kind_of: [TrueClass, FalseClass], default: false
attribute :time_zone, kind_of: String, default: nil
attribute :target_cpu, kind_of: Integer, default: nil
attribute :wrapper_java_initmemory, kind_of: Integer, default: nil
attribute :wrapper_java_maxmemory, kind_of: Integer, default: nil
# Misc
attribute :installed, kind_of: [TrueClass, FalseClass], default: false
......
......@@ -22,10 +22,17 @@ proxyPassword=<%= @resource.proxy_password %>
<% end %>
# Other Settings
name=<%= @resource.collector_name %>
<%= "hostName=#{@resource.host_name}" unless @resource.host_name.nil? %>
<%= "description=#{@resource.description}" unless @resource.description.nil? %>
<%= "category=#{@resource.category}" unless @resource.category.nil? %>
<%= "sources=#{@resource.sources}" unless @resource.sources.nil? %>
<%= "syncSources=#{@resource.sync_sources}" unless @resource.sync_sources.nil? %>
<%= "ephemeral=#{@resource.ephemeral}" unless @resource.ephemeral.nil? %>
<%= "clobber=#{@resource.clobber}" unless @resource.clobber.nil? %>
<%= "disableScriptSource=#{@resource.disable_script_source}" unless @resource.disable_script_source.nil? %>
<%= "disableActionSource=#{@resource.disable_action_source}" unless @resource.disable_action_source.nil? %>
<%= "disableUpgrade=#{@resource.disable_upgrade}" unless @resource.disable_upgrade.nil? %>
<%= "timeZone=#{@resource.time_zone}" unless @resource.time_zone.nil? %>
<%= "targetCPU=#{@resource.target_cpu}" unless @resource.target_cpu.nil? %>
<%= "wrapper.java.initmemory=#{@resource.wrapper_java_initmemory}" unless @resource.wrapper_java_initmemory.nil? %>
<%= "wrapper.java.maxmemory=#{@resource.wrapper_java_maxmemory}" unless @resource.wrapper_java_maxmemory.nil? %>
......@@ -9,11 +9,15 @@ end
sumologic_collector sumo_dir do
collector_name 'test-instance'
host_name 'example.com'
description 'A Test Kitchen instance'
category 'Misc'
sumo_access_id node['SUMO_ACCESS_ID']
sumo_access_key node['SUMO_ACCESS_KEY']
proxy_host 'proxy.test.com'
proxy_port 8080
ephemeral true
time_zone 'Etc/UTC'
skip_restart true unless node['SUMO_ACCESS_ID']
action :configure
end
......@@ -12,10 +12,14 @@ describe file("#{sumo_dir}/config/user.properties") do
it { is_expected.to exist }
its(:content) { is_expected.to match(/Generated by Chef/) }
its(:content) { is_expected.to match(/name=test-instance/) }
its(:content) { is_expected.to match(/hostName=example\.com/) }
its(:content) { is_expected.to match(/description=A Test Kitchen instance/) }
its(:content) { is_expected.to match(/category=Misc/) }
its(:content) { is_expected.to match(/accessid=#{ENV['SUMO_ACCESS_ID']}/) }
its(:content) { is_expected.to match(/accesskey=#{ENV['SUMO_ACCESS_KEY']}/) }
its(:content) { is_expected.to match(/ephemeral=true/) }
its(:content) { is_expected.to match(/proxyHost=proxy.test.com/) }
its(:content) { is_expected.to match(/proxyPort=8080/) }
its(:content) { is_expected.to match(/installerMode=true/) }
its(:content) { is_expected.to match(%r{timeZone=Etc/UTC}) }
end
Markdown is supported
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