diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md
index 048d2b55..6aaa603f 100644
--- a/.github/CONTRIBUTING.md
+++ b/.github/CONTRIBUTING.md
@@ -124,7 +124,7 @@ If you have Ruby 2.x or want a specific version of Puppet,
you must set an environment variable such as:
```sh
-export PUPPET_VERSION="~> 5.5.6"
+export PUPPET_GEM_VERSION="~> 6.1.0"
```
You can install all needed gems for spec tests into the modules directory by
@@ -232,19 +232,21 @@ simple tests against it after applying the module. You can run this
with:
```sh
-BEAKER_setfile=debian10-x64 bundle exec rake beaker
+BEAKER_PUPPET_COLLECTION=puppet7 BEAKER_setfile=debian11-64 bundle exec rake beaker
```
-You can replace the string `debian10` with any common operating system.
+You can replace the string `debian11` with any common operating system.
The following strings are known to work:
-* ubuntu1604
-* ubuntu1804
* ubuntu2004
-* debian9
-* debian10
+* ubuntu2204
+* debian11
* centos7
* centos8
+* centos9
+* almalinux8
+* almalinux9
+* fedora36
For more information and tips & tricks, see [voxpupuli-acceptance's documentation](https://github.com/voxpupuli/voxpupuli-acceptance#running-tests).
diff --git a/.github/SECURITY.md b/.github/SECURITY.md
deleted file mode 100644
index cacadf22..00000000
--- a/.github/SECURITY.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# Vox Pupuli Security Policy
-
-Our vulnerabilities reporting process is at https://voxpupuli.org/security/
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 4934774a..7216724f 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -4,78 +4,20 @@
name: CI
-on: pull_request
+on:
+ pull_request: {}
+ push:
+ branches:
+ - main
+ - master
-jobs:
- setup_matrix:
- name: 'Setup Test Matrix'
- runs-on: ubuntu-latest
- timeout-minutes: 40
- outputs:
- puppet_unit_test_matrix: ${{ steps.get-outputs.outputs.puppet_unit_test_matrix }}
- github_action_test_matrix: ${{ steps.get-outputs.outputs.github_action_test_matrix }}
- env:
- BUNDLE_WITHOUT: development:system_tests:release
- steps:
- - uses: actions/checkout@v2
- - name: Setup ruby
- uses: ruby/setup-ruby@v1
- with:
- ruby-version: '3.0'
- bundler-cache: true
- - name: Run static validations
- run: bundle exec rake validate lint check
- - name: Run rake rubocop
- run: bundle exec rake rubocop
- - name: Setup Test Matrix
- id: get-outputs
- run: bundle exec metadata2gha --use-fqdn --pidfile-workaround false
-
- unit:
- needs: setup_matrix
- runs-on: ubuntu-latest
- timeout-minutes: 40
- strategy:
- fail-fast: false
- matrix:
- include: ${{fromJson(needs.setup_matrix.outputs.puppet_unit_test_matrix)}}
- env:
- BUNDLE_WITHOUT: development:system_tests:release
- PUPPET_VERSION: "~> ${{ matrix.puppet }}.0"
- name: Puppet ${{ matrix.puppet }} (Ruby ${{ matrix.ruby }})
- steps:
- - uses: actions/checkout@v2
- - name: Setup ruby
- uses: ruby/setup-ruby@v1
- with:
- ruby-version: ${{ matrix.ruby }}
- bundler-cache: true
- - name: Run tests
- run: bundle exec rake parallel_spec
+concurrency:
+ group: ${{ github.ref_name }}
+ cancel-in-progress: true
- acceptance:
- needs: setup_matrix
- runs-on: ubuntu-latest
- env:
- BUNDLE_WITHOUT: development:test:release
- strategy:
- fail-fast: false
- matrix:
- include: ${{fromJson(needs.setup_matrix.outputs.github_action_test_matrix)}}
- name: ${{ matrix.puppet.name }} - ${{ matrix.setfile.name }}
- steps:
- - name: Enable IPv6 on docker
- run: |
- echo '{"ipv6":true,"fixed-cidr-v6":"2001:db8:1::/64"}' | sudo tee /etc/docker/daemon.json
- sudo service docker restart
- - uses: actions/checkout@v2
- - name: Setup ruby
- uses: ruby/setup-ruby@v1
- with:
- ruby-version: '3.0'
- bundler-cache: true
- - name: Run tests
- run: bundle exec rake beaker
- env:
- BEAKER_PUPPET_COLLECTION: ${{ matrix.puppet.collection }}
- BEAKER_setfile: ${{ matrix.setfile.value }}
+jobs:
+ puppet:
+ name: Puppet
+ uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v2
+ with:
+ pidfile_workaround: 'false'
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 664ba694..55324aa6 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -9,26 +9,14 @@ on:
tags:
- '*'
-env:
- BUNDLE_WITHOUT: development:test:system_tests
-
jobs:
- deploy:
- name: 'deploy to forge'
- runs-on: ubuntu-latest
- if: github.repository_owner == 'voxpupuli'
- steps:
- - name: Checkout repository
- uses: actions/checkout@v2
- - name: Setup Ruby
- uses: ruby/setup-ruby@v1
- with:
- ruby-version: '2.7'
- bundler-cache: true
- - name: Build and Deploy
- env:
- # Configure secrets here:
- # https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets
- BLACKSMITH_FORGE_USERNAME: '${{ secrets.PUPPET_FORGE_USERNAME }}'
- BLACKSMITH_FORGE_API_KEY: '${{ secrets.PUPPET_FORGE_API_KEY }}'
- run: bundle exec rake module:push
+ release:
+ name: Release
+ uses: voxpupuli/gha-puppet/.github/workflows/release.yml@v2
+ with:
+ allowed_owner: 'voxpupuli'
+ secrets:
+ # Configure secrets here:
+ # https://docs.github.com/en/actions/security-guides/encrypted-secrets
+ username: ${{ secrets.PUPPET_FORGE_USERNAME }}
+ api_key: ${{ secrets.PUPPET_FORGE_API_KEY }}
diff --git a/.gitignore b/.gitignore
index 9b95224c..84fd904c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,23 +1,23 @@
# Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
-pkg/
-Gemfile.lock
-Gemfile.local
-vendor/
-.vendor/
-spec/fixtures/manifests/
-spec/fixtures/modules/
-.vagrant/
-.bundle/
-.ruby-version
-coverage/
-log/
-.idea/
-.dependencies/
-.librarian/
-Puppetfile.lock
+/pkg/
+/Gemfile.lock
+/Gemfile.local
+/vendor/
+/.vendor/
+/spec/fixtures/manifests/
+/spec/fixtures/modules/
+/.vagrant/
+/.bundle/
+/.ruby-version
+/coverage/
+/log/
+/.idea/
+/.dependencies/
+/.librarian/
+/Puppetfile.lock
*.iml
.*.sw?
-.yardoc/
-Guardfile
+/.yardoc/
+/Guardfile
diff --git a/.msync.yml b/.msync.yml
index 9c9f18f9..f46ee025 100644
--- a/.msync.yml
+++ b/.msync.yml
@@ -2,4 +2,4 @@
# Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
-modulesync_config_version: '4.1.0'
+modulesync_config_version: '7.3.0'
diff --git a/.pmtignore b/.pmtignore
index 65f50514..10b98306 100644
--- a/.pmtignore
+++ b/.pmtignore
@@ -1,37 +1,38 @@
# Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
-docs/
-pkg/
-Gemfile
-Gemfile.lock
-Gemfile.local
-vendor/
-.vendor/
-spec/
-Rakefile
-.vagrant/
-.bundle/
-.ruby-version
-coverage/
-log/
-.idea/
-.dependencies/
-.github/
-.librarian/
-Puppetfile.lock
+/docs/
+/pkg/
+/Gemfile
+/Gemfile.lock
+/Gemfile.local
+/vendor/
+/.vendor/
+/spec/
+/Rakefile
+/.vagrant/
+/.bundle/
+/.ruby-version
+/coverage/
+/log/
+/.idea/
+/.dependencies/
+/.github/
+/.librarian/
+/Puppetfile.lock
*.iml
-.editorconfig
-.fixtures.yml
-.gitignore
-.msync.yml
-.overcommit.yml
-.pmtignore
-.rspec
-.rspec_parallel
-.rubocop.yml
-.sync.yml
+/.editorconfig
+/.fixtures.yml
+/.gitignore
+/.msync.yml
+/.overcommit.yml
+/.pmtignore
+/.rspec
+/.rspec_parallel
+/.rubocop.yml
+/.sync.yml
.*.sw?
-.yardoc/
-.yardopts
-Dockerfile
+/.yardoc/
+/.yardopts
+/Dockerfile
+/HISTORY.md
diff --git a/.puppet-lint.rc b/.puppet-lint.rc
new file mode 100644
index 00000000..dd8272c7
--- /dev/null
+++ b/.puppet-lint.rc
@@ -0,0 +1,3 @@
+--fail-on-warnings
+--no-parameter_documentation-check
+--no-parameter_types-check
diff --git a/.rubocop.yml b/.rubocop.yml
index 53ac1898..fded90cf 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -2,5 +2,6 @@
# Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
+inherit_from: .rubocop_todo.yml
inherit_gem:
voxpupuli-test: rubocop.yml
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
new file mode 100644
index 00000000..87167fb6
--- /dev/null
+++ b/.rubocop_todo.yml
@@ -0,0 +1,20 @@
+# This configuration was generated by
+# `rubocop --auto-gen-config`
+# on 2023-08-17 21:38:35 UTC using RuboCop version 1.50.2.
+# The point is for the user to remove these configuration records
+# one by one as the offenses are removed from the code base.
+# Note that changes in the inspected code, or installation of new
+# versions of RuboCop, may require this file to be generated again.
+
+# Offense count: 2
+# This cop supports unsafe autocorrection (--autocorrect-all).
+Style/SlicingWithRange:
+ Exclude:
+ - 'lib/puppet_x/voxpupuli/splunk/util.rb'
+
+# Offense count: 1
+# This cop supports unsafe autocorrection (--autocorrect-all).
+# Configuration parameters: Mode.
+Style/StringConcatenation:
+ Exclude:
+ - 'spec/spec_helper.rb'
diff --git a/Dockerfile b/Dockerfile
index e3cf307f..8dd82d63 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -8,7 +8,7 @@ WORKDIR /opt/puppet
# https://github.com/puppetlabs/puppet/blob/06ad255754a38f22fb3a22c7c4f1e2ce453d01cb/lib/puppet/provider/service/runit.rb#L39
RUN mkdir -p /etc/sv
-ARG PUPPET_VERSION="~> 6.0"
+ARG PUPPET_GEM_VERSION="~> 6.0"
ARG PARALLEL_TEST_PROCESSORS=4
# Cache gems
diff --git a/Gemfile b/Gemfile
index 590bbedf..a4a3b204 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,13 +1,13 @@
# Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
-source ENV['GEM_SOURCE'] || "https://rubygems.org"
+source ENV['GEM_SOURCE'] || 'https://rubygems.org'
group :test do
- gem 'voxpupuli-test', '~> 2.1', :require => false
+ gem 'voxpupuli-test', '~> 7.0', :require => false
gem 'coveralls', :require => false
gem 'simplecov-console', :require => false
- gem 'puppet_metadata', '~> 1.0', :require => false
+ gem 'puppet_metadata', '~> 3.5', :require => false
end
group :development do
@@ -16,19 +16,17 @@ group :development do
end
group :system_tests do
- gem 'voxpupuli-acceptance', '~> 1.0', :require => false
+ gem 'voxpupuli-acceptance', '~> 3.0', :require => false
end
group :release do
- gem 'github_changelog_generator', '>= 1.16.1', :require => false
- gem 'voxpupuli-release', '>= 1.0.2', :require => false
- gem 'puppet-strings', '>= 2.2', :require => false
+ gem 'voxpupuli-release', '~> 3.0', :require => false
end
gem 'rake', :require => false
gem 'facter', ENV['FACTER_GEM_VERSION'], :require => false, :groups => [:test]
-puppetversion = ENV['PUPPET_VERSION'] || '>= 6.0'
+puppetversion = ENV['PUPPET_GEM_VERSION'] || '~> 7.24'
gem 'puppet', puppetversion, :require => false, :groups => [:test]
# vim: syntax=ruby
diff --git a/REFERENCE.md b/REFERENCE.md
index f16a13fd..ffec7499 100644
--- a/REFERENCE.md
+++ b/REFERENCE.md
@@ -8,50 +8,50 @@
* [`splunk`](#splunk): This class is unused and doesn't do anything but make default data
accessible
-* [`splunk::enterprise`](#splunkenterprise): Install and configure an instance of Splunk Enterprise
-* [`splunk::enterprise::config`](#splunkenterpriseconfig): Private class declared by Class[splunk::enterprise] to contain all the
+* [`splunk::enterprise`](#splunk--enterprise): Install and configure an instance of Splunk Enterprise
+* [`splunk::enterprise::config`](#splunk--enterprise--config): Private class declared by Class[splunk::enterprise] to contain all the
configuration needed for a base install of Splunk Enterprise
-* [`splunk::enterprise::install`](#splunkenterpriseinstall): Private class declared by Class[splunk::enterprise] to contain or define
+* [`splunk::enterprise::install`](#splunk--enterprise--install): Private class declared by Class[splunk::enterprise] to contain or define
through additional platform specific sub-class, the required steps
for successfully installing Splunk Enterprise
-* [`splunk::enterprise::install::nix`](#splunkenterpriseinstallnix): Private class declared by Class[splunk::enterprise::install] to provide
+* [`splunk::enterprise::install::nix`](#splunk--enterprise--install--nix): Private class declared by Class[splunk::enterprise::install] to provide
platform specific installation steps on Linux or Unix type systems.
-* [`splunk::enterprise::password::manage`](#splunkenterprisepasswordmanage): Implements the direct management of the Splunk Enterprise admin password
+* [`splunk::enterprise::password::manage`](#splunk--enterprise--password--manage): Implements the direct management of the Splunk Enterprise admin password
so it can be used outside of regular management of the whole stack to
facilitate admin password resets through Bolt Plans.
Note: Entirely done to make this implementation consistent with the method
used to manage admin password seeding.
-* [`splunk::enterprise::password::seed`](#splunkenterprisepasswordseed): Implements the seeding and reseeding of the Splunk Enterprise admin password
+* [`splunk::enterprise::password::seed`](#splunk--enterprise--password--seed): Implements the seeding and reseeding of the Splunk Enterprise admin password
so it can be used outside of regular management of the whole stack to
facilitate admin password resets through Bolt Plans
-* [`splunk::enterprise::service`](#splunkenterpriseservice): Private class declared by Class[splunk::enterprise] to define a service
+* [`splunk::enterprise::service`](#splunk--enterprise--service): Private class declared by Class[splunk::enterprise] to define a service
as its understood by Puppet using a dynamic set of data or platform specific
sub-classes
-* [`splunk::enterprise::service::nix`](#splunkenterpriseservicenix): Private class declared by Class[splunk::enterprise::service] to provide
+* [`splunk::enterprise::service::nix`](#splunk--enterprise--service--nix): Private class declared by Class[splunk::enterprise::service] to provide
platform specific service management on Linux or Unix type systems.
-* [`splunk::forwarder`](#splunkforwarder): Install and configure an instance of Splunk Universal Forwarder
-* [`splunk::forwarder::config`](#splunkforwarderconfig): Private class declared by Class[splunk::forwarder] to contain all the
+* [`splunk::forwarder`](#splunk--forwarder): Install and configure an instance of Splunk Universal Forwarder
+* [`splunk::forwarder::config`](#splunk--forwarder--config): Private class declared by Class[splunk::forwarder] to contain all the
configuration needed for a base install of the Splunk Universal
Forwarder
-* [`splunk::forwarder::install`](#splunkforwarderinstall): Private class declared by Class[splunk::forwarder] to contain or define
+* [`splunk::forwarder::install`](#splunk--forwarder--install): Private class declared by Class[splunk::forwarder] to contain or define
through additional platform specific sub-class, the required steps
for successfully installing the Splunk Universal Forwarder
-* [`splunk::forwarder::password::manage`](#splunkforwarderpasswordmanage): Implements the direct management of the Splunk Forwarder admin password
+* [`splunk::forwarder::password::manage`](#splunk--forwarder--password--manage): Implements the direct management of the Splunk Forwarder admin password
so it can be used outside of regular management of the whole stack to
facilitate admin password resets through Bolt Plans.
Note: Entirely done to make this implementation consistent with the method
used to manage admin password seeding.
-* [`splunk::forwarder::password::seed`](#splunkforwarderpasswordseed): Implements the seeding and reseeding of the Splunk Forwarder admin password
+* [`splunk::forwarder::password::seed`](#splunk--forwarder--password--seed): Implements the seeding and reseeding of the Splunk Forwarder admin password
so it can be used outside of regular management of the whole stack to
facilitate admin password resets through Bolt Plans
-* [`splunk::forwarder::service`](#splunkforwarderservice): Private class declared by Class[splunk::forwarder] to define a service as
+* [`splunk::forwarder::service`](#splunk--forwarder--service): Private class declared by Class[splunk::forwarder] to define a service as
its understood by Puppet using a dynamic set of data or platform specific
sub-classes
-* [`splunk::forwarder::service::nix`](#splunkforwarderservicenix): Private class declared by Class[splunk::forwarder::service] to provide
+* [`splunk::forwarder::service::nix`](#splunk--forwarder--service--nix): Private class declared by Class[splunk::forwarder::service] to provide
platform specific service management on Linux or Unix type systems.
-* [`splunk::params`](#splunkparams): This class takes a small number of arguments (can be set through Hiera) and
+* [`splunk::params`](#splunk--params): This class takes a small number of arguments (can be set through Hiera) and
generates sane default values installation media names and locations.
Default ports can also be specified here. This is a parameters class, and
contributes no resources to the graph. Rather, it only sets values for
@@ -59,7 +59,7 @@ parameters to be consumed by child classes.
### Defined types
-* [`splunk::addon`](#splunkaddon): Defined type for deploying Splunk Add-ons and Apps from either OS packages
+* [`splunk::addon`](#splunk--addon): Defined type for deploying Splunk Add-ons and Apps from either OS packages
or via splunkbase compatible archives
### Resource types
@@ -92,8 +92,8 @@ or via splunkbase compatible archives
### Data types
-* [`Splunk::Entinstalloptions`](#splunkentinstalloptions)
-* [`Splunk::Fwdinstalloptions`](#splunkfwdinstalloptions)
+* [`Splunk::Entinstalloptions`](#Splunk--Entinstalloptions)
+* [`Splunk::Fwdinstalloptions`](#Splunk--Fwdinstalloptions)
## Classes
@@ -105,7 +105,7 @@ accessible
* **Note** If you were expecting this class to setup an instance of Splunk
Enterprise then please look to Class[splunk::enterprise].
-### `splunk::enterprise`
+### `splunk::enterprise`
Install and configure an instance of Splunk Enterprise
@@ -134,56 +134,56 @@ class { 'splunk::enterprise':
The following parameters are available in the `splunk::enterprise` class:
-* [`version`](#version)
-* [`package_name`](#package_name)
-* [`package_ensure`](#package_ensure)
-* [`staging_dir`](#staging_dir)
-* [`path_delimiter`](#path_delimiter)
-* [`enterprise_package_src`](#enterprise_package_src)
-* [`package_provider`](#package_provider)
-* [`manage_package_source`](#manage_package_source)
-* [`package_source`](#package_source)
-* [`install_options`](#install_options)
-* [`splunk_user`](#splunk_user)
-* [`enterprise_homedir`](#enterprise_homedir)
-* [`enterprise_confdir`](#enterprise_confdir)
-* [`service_name`](#service_name)
-* [`service_file`](#service_file)
-* [`boot_start`](#boot_start)
-* [`use_default_config`](#use_default_config)
-* [`input_default_host`](#input_default_host)
-* [`input_connection_host`](#input_connection_host)
-* [`splunkd_listen`](#splunkd_listen)
-* [`logging_port`](#logging_port)
-* [`splunkd_port`](#splunkd_port)
-* [`web_httpport`](#web_httpport)
-* [`purge_inputs`](#purge_inputs)
-* [`purge_outputs`](#purge_outputs)
-* [`purge_authentication`](#purge_authentication)
-* [`purge_authorize`](#purge_authorize)
-* [`purge_distsearch`](#purge_distsearch)
-* [`purge_indexes`](#purge_indexes)
-* [`purge_limits`](#purge_limits)
-* [`purge_props`](#purge_props)
-* [`purge_server`](#purge_server)
-* [`purge_transforms`](#purge_transforms)
-* [`purge_web`](#purge_web)
-* [`manage_password`](#manage_password)
-* [`seed_password`](#seed_password)
-* [`reset_seeded_password`](#reset_seeded_password)
-* [`password_config_file`](#password_config_file)
-* [`seed_config_file`](#seed_config_file)
-* [`seed_user`](#seed_user)
-* [`password_content`](#password_content)
-* [`password_hash`](#password_hash)
-* [`secret_file`](#secret_file)
-* [`secret`](#secret)
-* [`purge_alert_actions`](#purge_alert_actions)
-* [`purge_deploymentclient`](#purge_deploymentclient)
-* [`purge_serverclass`](#purge_serverclass)
-* [`purge_uiprefs`](#purge_uiprefs)
-
-##### `version`
+* [`version`](#-splunk--enterprise--version)
+* [`package_name`](#-splunk--enterprise--package_name)
+* [`package_ensure`](#-splunk--enterprise--package_ensure)
+* [`staging_dir`](#-splunk--enterprise--staging_dir)
+* [`path_delimiter`](#-splunk--enterprise--path_delimiter)
+* [`enterprise_package_src`](#-splunk--enterprise--enterprise_package_src)
+* [`package_provider`](#-splunk--enterprise--package_provider)
+* [`manage_package_source`](#-splunk--enterprise--manage_package_source)
+* [`package_source`](#-splunk--enterprise--package_source)
+* [`install_options`](#-splunk--enterprise--install_options)
+* [`splunk_user`](#-splunk--enterprise--splunk_user)
+* [`enterprise_homedir`](#-splunk--enterprise--enterprise_homedir)
+* [`enterprise_confdir`](#-splunk--enterprise--enterprise_confdir)
+* [`service_name`](#-splunk--enterprise--service_name)
+* [`service_file`](#-splunk--enterprise--service_file)
+* [`boot_start`](#-splunk--enterprise--boot_start)
+* [`use_default_config`](#-splunk--enterprise--use_default_config)
+* [`input_default_host`](#-splunk--enterprise--input_default_host)
+* [`input_connection_host`](#-splunk--enterprise--input_connection_host)
+* [`splunkd_listen`](#-splunk--enterprise--splunkd_listen)
+* [`logging_port`](#-splunk--enterprise--logging_port)
+* [`splunkd_port`](#-splunk--enterprise--splunkd_port)
+* [`web_httpport`](#-splunk--enterprise--web_httpport)
+* [`purge_inputs`](#-splunk--enterprise--purge_inputs)
+* [`purge_outputs`](#-splunk--enterprise--purge_outputs)
+* [`purge_authentication`](#-splunk--enterprise--purge_authentication)
+* [`purge_authorize`](#-splunk--enterprise--purge_authorize)
+* [`purge_distsearch`](#-splunk--enterprise--purge_distsearch)
+* [`purge_indexes`](#-splunk--enterprise--purge_indexes)
+* [`purge_limits`](#-splunk--enterprise--purge_limits)
+* [`purge_props`](#-splunk--enterprise--purge_props)
+* [`purge_server`](#-splunk--enterprise--purge_server)
+* [`purge_transforms`](#-splunk--enterprise--purge_transforms)
+* [`purge_web`](#-splunk--enterprise--purge_web)
+* [`manage_password`](#-splunk--enterprise--manage_password)
+* [`seed_password`](#-splunk--enterprise--seed_password)
+* [`reset_seeded_password`](#-splunk--enterprise--reset_seeded_password)
+* [`password_config_file`](#-splunk--enterprise--password_config_file)
+* [`seed_config_file`](#-splunk--enterprise--seed_config_file)
+* [`seed_user`](#-splunk--enterprise--seed_user)
+* [`password_content`](#-splunk--enterprise--password_content)
+* [`password_hash`](#-splunk--enterprise--password_hash)
+* [`secret_file`](#-splunk--enterprise--secret_file)
+* [`secret`](#-splunk--enterprise--secret)
+* [`purge_alert_actions`](#-splunk--enterprise--purge_alert_actions)
+* [`purge_deploymentclient`](#-splunk--enterprise--purge_deploymentclient)
+* [`purge_serverclass`](#-splunk--enterprise--purge_serverclass)
+* [`purge_uiprefs`](#-splunk--enterprise--purge_uiprefs)
+
+##### `version`
Data type: `String[1]`
@@ -192,7 +192,7 @@ manage.
Default value: `$splunk::params::version`
-##### `package_name`
+##### `package_name`
Data type: `String[1]`
@@ -200,7 +200,7 @@ The name of the package(s) Puppet will use to install Splunk.
Default value: `$splunk::params::enterprise_package_name`
-##### `package_ensure`
+##### `package_ensure`
Data type: `String[1]`
@@ -208,7 +208,7 @@ Ensure parameter which will get passed to the Splunk package resource.
Default value: `$splunk::params::enterprise_package_ensure`
-##### `staging_dir`
+##### `staging_dir`
Data type: `String[1]`
@@ -216,7 +216,7 @@ Root of the archive path to host the Splunk package.
Default value: `$splunk::params::staging_dir`
-##### `path_delimiter`
+##### `path_delimiter`
Data type: `String[1]`
@@ -224,7 +224,7 @@ The path separator used in the archived path of the Splunk package.
Default value: `$splunk::params::path_delimiter`
-##### `enterprise_package_src`
+##### `enterprise_package_src`
Data type: `String[1]`
@@ -236,7 +236,7 @@ a UNC path to the MSI.
Default value: `$splunk::params::enterprise_package_src`
-##### `package_provider`
+##### `package_provider`
Data type: `Optional[String[1]]`
@@ -244,15 +244,15 @@ The package management system used to host the Splunk packages.
Default value: `$splunk::params::package_provider`
-##### `manage_package_source`
+##### `manage_package_source`
Data type: `Boolean`
Whether or not to use the supplied `enterprise_package_src` param.
-Default value: ``true``
+Default value: `true`
-##### `package_source`
+##### `package_source`
Data type: `Optional[String[1]]`
@@ -262,9 +262,9 @@ MSI, etc). If `enterprise_package_src` parameter is set in splunk::params and
it is required. The URL can be of any protocol supported by the puppet/archive
module. On Windows, this can be a UNC path to the MSI.
-Default value: ``undef``
+Default value: `undef`
-##### `install_options`
+##### `install_options`
Data type: `Splunk::Entinstalloptions`
@@ -272,7 +272,7 @@ This variable is passed to the package resources' *install_options* parameter.
Default value: `$splunk::params::enterprise_install_options`
-##### `splunk_user`
+##### `splunk_user`
Data type: `String[1]`
@@ -280,7 +280,7 @@ The user to run Splunk as.
Default value: `$splunk::params::splunk_user`
-##### `enterprise_homedir`
+##### `enterprise_homedir`
Data type: `Stdlib::Absolutepath`
@@ -288,7 +288,7 @@ Specifies the Splunk Enterprise home directory.
Default value: `$splunk::params::enterprise_homedir`
-##### `enterprise_confdir`
+##### `enterprise_confdir`
Data type: `Stdlib::Absolutepath`
@@ -296,7 +296,7 @@ Specifies the Splunk Enterprise configuration directory.
Default value: `$splunk::params::enterprise_confdir`
-##### `service_name`
+##### `service_name`
Data type: `String[1]`
@@ -304,7 +304,7 @@ The name of the Splunk Enterprise service.
Default value: `$splunk::params::enterprise_service`
-##### `service_file`
+##### `service_file`
Data type: `Stdlib::Absolutepath`
@@ -312,7 +312,7 @@ The path to the Splunk Enterprise service file.
Default value: `$splunk::params::enterprise_service_file`
-##### `boot_start`
+##### `boot_start`
Data type: `Boolean`
@@ -321,16 +321,16 @@ manage the Splunk Enterprise service.
Default value: `$splunk::params::boot_start`
-##### `use_default_config`
+##### `use_default_config`
Data type: `Boolean`
Whether or not the module should manage a default set of Splunk Enterprise
configuration parameters.
-Default value: ``true``
+Default value: `true`
-##### `input_default_host`
+##### `input_default_host`
Data type: `String[1]`
@@ -338,7 +338,7 @@ Part of the default config. Sets the `splunk_input` default host.
Default value: `$facts['networking']['fqdn']`
-##### `input_connection_host`
+##### `input_connection_host`
Data type: `String[1]`
@@ -346,7 +346,7 @@ Part of the default config. Sets the `splunk_input` connection host.
Default value: `'dns'`
-##### `splunkd_listen`
+##### `splunkd_listen`
Data type: `Stdlib::IP::Address`
@@ -354,7 +354,7 @@ The address on which splunkd should listen.
Default value: `'127.0.0.1'`
-##### `logging_port`
+##### `logging_port`
Data type: `Stdlib::Port`
@@ -362,7 +362,7 @@ The port to receive TCP logs on.
Default value: `$splunk::params::logging_port`
-##### `splunkd_port`
+##### `splunkd_port`
Data type: `Stdlib::Port`
@@ -370,7 +370,7 @@ The management port for Splunk.
Default value: `$splunk::params::splunkd_port`
-##### `web_httpport`
+##### `web_httpport`
Data type: `Stdlib::Port`
@@ -378,106 +378,106 @@ The port on which to service the Splunk Web interface.
Default value: `8000`
-##### `purge_inputs`
+##### `purge_inputs`
Data type: `Boolean`
If set to true, inputs.conf will be purged of configuration that is
no longer managed by the `splunk_input` type.
-Default value: ``false``
+Default value: `false`
-##### `purge_outputs`
+##### `purge_outputs`
Data type: `Boolean`
If set to true, outputs.conf will be purged of configuration that is
no longer managed by the `splunk_output` type.
-Default value: ``false``
+Default value: `false`
-##### `purge_authentication`
+##### `purge_authentication`
Data type: `Boolean`
If set to true, authentication.conf will be purged of configuration
that is no longer managed by the `splunk_authentication` type.
-Default value: ``false``
+Default value: `false`
-##### `purge_authorize`
+##### `purge_authorize`
Data type: `Boolean`
If set to true, authorize.conf will be purged of configuration that
is no longer managed by the `splunk_authorize` type.
-Default value: ``false``
+Default value: `false`
-##### `purge_distsearch`
+##### `purge_distsearch`
Data type: `Boolean`
If set to true, distsearch.conf will be purged of configuration that
is no longer managed by the `splunk_distsearch` type.
-Default value: ``false``
+Default value: `false`
-##### `purge_indexes`
+##### `purge_indexes`
Data type: `Boolean`
If set to true, indexes.conf will be purged of configuration that is
no longer managed by the `splunk_indexes` type.
-Default value: ``false``
+Default value: `false`
-##### `purge_limits`
+##### `purge_limits`
Data type: `Boolean`
If set to true, limits.conf will be purged of configuration that is
no longer managed by the `splunk_limits` type.
-Default value: ``false``
+Default value: `false`
-##### `purge_props`
+##### `purge_props`
Data type: `Boolean`
If set to true, props.conf will be purged of configuration that is
no longer managed by the `splunk_props` type.
-Default value: ``false``
+Default value: `false`
-##### `purge_server`
+##### `purge_server`
Data type: `Boolean`
If set to true, server.conf will be purged of configuration that is
no longer managed by the `splunk_server` type.
-Default value: ``false``
+Default value: `false`
-##### `purge_transforms`
+##### `purge_transforms`
Data type: `Boolean`
If set to true, transforms.conf will be purged of configuration that
is no longer managed by the `splunk_transforms` type.
-Default value: ``false``
+Default value: `false`
-##### `purge_web`
+##### `purge_web`
Data type: `Boolean`
If set to true, web.conf will be purged of configuration that is no
longer managed by the `splunk_web type`.
-Default value: ``false``
+Default value: `false`
-##### `manage_password`
+##### `manage_password`
Data type: `Boolean`
@@ -485,7 +485,7 @@ If set to true, Manage the contents of splunk.secret and passwd.
Default value: `$splunk::params::manage_password`
-##### `seed_password`
+##### `seed_password`
Data type: `Boolean`
@@ -493,7 +493,7 @@ If set to true, Manage the contents of splunk.secret and user-seed.conf.
Default value: `$splunk::params::seed_password`
-##### `reset_seeded_password`
+##### `reset_seeded_password`
Data type: `Boolean`
@@ -502,7 +502,7 @@ import process on restart of the Splunk services.
Default value: `$splunk::params::reset_seeded_password`
-##### `password_config_file`
+##### `password_config_file`
Data type: `Stdlib::Absolutepath`
@@ -511,7 +511,7 @@ Which file to put the password in i.e. in linux it would be
Default value: `$splunk::params::enterprise_password_config_file`
-##### `seed_config_file`
+##### `seed_config_file`
Data type: `Stdlib::Absolutepath`
@@ -520,7 +520,7 @@ restart.
Default value: `$splunk::params::enterprise_seed_config_file`
-##### `seed_user`
+##### `seed_user`
Data type: `String[1]`
@@ -528,7 +528,7 @@ The local user (usually 'admin') imported by Splunk.
Default value: `$splunk::params::seed_user`
-##### `password_content`
+##### `password_content`
Data type: `String[1]`
@@ -536,7 +536,7 @@ The hashed password username/details for the user.
Default value: `$splunk::params::password_content`
-##### `password_hash`
+##### `password_hash`
Data type: `String[1]`
@@ -544,7 +544,7 @@ The hashed password for the admin user.
Default value: `$splunk::params::password_hash`
-##### `secret_file`
+##### `secret_file`
Data type: `Stdlib::Absolutepath`
@@ -552,7 +552,7 @@ Which file we should put the secret in.
Default value: `$splunk::params::enterprise_secret_file`
-##### `secret`
+##### `secret`
Data type: `String[1]`
@@ -560,55 +560,55 @@ The secret used to salt the splunk password.
Default value: `$splunk::params::secret`
-##### `purge_alert_actions`
+##### `purge_alert_actions`
Data type: `Boolean`
-Default value: ``false``
+Default value: `false`
-##### `purge_deploymentclient`
+##### `purge_deploymentclient`
Data type: `Boolean`
-Default value: ``false``
+Default value: `false`
-##### `purge_serverclass`
+##### `purge_serverclass`
Data type: `Boolean`
-Default value: ``false``
+Default value: `false`
-##### `purge_uiprefs`
+##### `purge_uiprefs`
Data type: `Boolean`
-Default value: ``false``
+Default value: `false`
-### `splunk::enterprise::config`
+### `splunk::enterprise::config`
Private class declared by Class[splunk::enterprise] to contain all the
configuration needed for a base install of Splunk Enterprise
-### `splunk::enterprise::install`
+### `splunk::enterprise::install`
Private class declared by Class[splunk::enterprise] to contain or define
through additional platform specific sub-class, the required steps
for successfully installing Splunk Enterprise
-### `splunk::enterprise::install::nix`
+### `splunk::enterprise::install::nix`
Private class declared by Class[splunk::enterprise::install] to provide
platform specific installation steps on Linux or Unix type systems.
-### `splunk::enterprise::password::manage`
+### `splunk::enterprise::password::manage`
Implements the direct management of the Splunk Enterprise admin password
so it can be used outside of regular management of the whole stack to
@@ -621,16 +621,16 @@ used to manage admin password seeding.
The following parameters are available in the `splunk::enterprise::password::manage` class:
-* [`manage_password`](#manage_password)
-* [`password_config_file`](#password_config_file)
-* [`password_content`](#password_content)
-* [`secret_file`](#secret_file)
-* [`secret`](#secret)
-* [`service`](#service)
-* [`mode`](#mode)
-* [`splunk_user`](#splunk_user)
+* [`manage_password`](#-splunk--enterprise--password--manage--manage_password)
+* [`password_config_file`](#-splunk--enterprise--password--manage--password_config_file)
+* [`password_content`](#-splunk--enterprise--password--manage--password_content)
+* [`secret_file`](#-splunk--enterprise--password--manage--secret_file)
+* [`secret`](#-splunk--enterprise--password--manage--secret)
+* [`service`](#-splunk--enterprise--password--manage--service)
+* [`mode`](#-splunk--enterprise--password--manage--mode)
+* [`splunk_user`](#-splunk--enterprise--password--manage--splunk_user)
-##### `manage_password`
+##### `manage_password`
Data type: `Boolean`
@@ -638,7 +638,7 @@ If set to true, Manage the contents of splunk.secret and passwd.
Default value: `$splunk::params::manage_password`
-##### `password_config_file`
+##### `password_config_file`
Data type: `Stdlib::Absolutepath`
@@ -647,7 +647,7 @@ Which file to put the password in i.e. in linux it would be
Default value: `$splunk::params::forwarder_password_config_file`
-##### `password_content`
+##### `password_content`
Data type: `String[1]`
@@ -655,7 +655,7 @@ The hashed password username/details for the user.
Default value: `$splunk::params::password_content`
-##### `secret_file`
+##### `secret_file`
Data type: `Stdlib::Absolutepath`
@@ -663,7 +663,7 @@ Which file we should put the secret in.
Default value: `$splunk::params::forwarder_secret_file`
-##### `secret`
+##### `secret`
Data type: `String[1]`
@@ -671,7 +671,7 @@ The secret used to salt the splunk password.
Default value: `$splunk::params::secret`
-##### `service`
+##### `service`
Data type: `String[1]`
@@ -680,7 +680,7 @@ are updated, not applicable when running in agent mode.
Default value: `$splunk::params::enterprise_service`
-##### `mode`
+##### `mode`
Data type: `Enum['agent', 'bolt']`
@@ -692,7 +692,7 @@ Bolt
Default value: `'bolt'`
-##### `splunk_user`
+##### `splunk_user`
Data type: `String[1]`
@@ -700,7 +700,7 @@ Data type: `String[1]`
Default value: `$splunk::params::splunk_user`
-### `splunk::enterprise::password::seed`
+### `splunk::enterprise::password::seed`
Implements the seeding and reseeding of the Splunk Enterprise admin password
so it can be used outside of regular management of the whole stack to
@@ -710,18 +710,18 @@ facilitate admin password resets through Bolt Plans
The following parameters are available in the `splunk::enterprise::password::seed` class:
-* [`reset_seeded_password`](#reset_seeded_password)
-* [`password_config_file`](#password_config_file)
-* [`seed_config_file`](#seed_config_file)
-* [`seed_user`](#seed_user)
-* [`password_hash`](#password_hash)
-* [`secret_file`](#secret_file)
-* [`secret`](#secret)
-* [`service`](#service)
-* [`mode`](#mode)
-* [`splunk_user`](#splunk_user)
+* [`reset_seeded_password`](#-splunk--enterprise--password--seed--reset_seeded_password)
+* [`password_config_file`](#-splunk--enterprise--password--seed--password_config_file)
+* [`seed_config_file`](#-splunk--enterprise--password--seed--seed_config_file)
+* [`seed_user`](#-splunk--enterprise--password--seed--seed_user)
+* [`password_hash`](#-splunk--enterprise--password--seed--password_hash)
+* [`secret_file`](#-splunk--enterprise--password--seed--secret_file)
+* [`secret`](#-splunk--enterprise--password--seed--secret)
+* [`service`](#-splunk--enterprise--password--seed--service)
+* [`mode`](#-splunk--enterprise--password--seed--mode)
+* [`splunk_user`](#-splunk--enterprise--password--seed--splunk_user)
-##### `reset_seeded_password`
+##### `reset_seeded_password`
Data type: `Boolean`
@@ -730,7 +730,7 @@ import process on restart of the Splunk services.
Default value: `$splunk::params::reset_seeded_password`
-##### `password_config_file`
+##### `password_config_file`
Data type: `Stdlib::Absolutepath`
@@ -739,7 +739,7 @@ Which file to put the password in i.e. in linux it would be
Default value: `$splunk::params::enterprise_password_config_file`
-##### `seed_config_file`
+##### `seed_config_file`
Data type: `Stdlib::Absolutepath`
@@ -748,7 +748,7 @@ restart.
Default value: `$splunk::params::enterprise_seed_config_file`
-##### `seed_user`
+##### `seed_user`
Data type: `String[1]`
@@ -756,7 +756,7 @@ The local user (usually 'admin') imported by Splunk.
Default value: `$splunk::params::seed_user`
-##### `password_hash`
+##### `password_hash`
Data type: `String[1]`
@@ -764,7 +764,7 @@ The hashed password for the admin user.
Default value: `$splunk::params::password_hash`
-##### `secret_file`
+##### `secret_file`
Data type: `Stdlib::Absolutepath`
@@ -772,7 +772,7 @@ Which file we should put the secret in.
Default value: `$splunk::params::enterprise_secret_file`
-##### `secret`
+##### `secret`
Data type: `String[1]`
@@ -780,7 +780,7 @@ The secret used to salt the splunk password.
Default value: `$splunk::params::secret`
-##### `service`
+##### `service`
Data type: `String[1]`
@@ -789,7 +789,7 @@ are updated, not applicable when running in agent mode.
Default value: `$splunk::params::enterprise_service`
-##### `mode`
+##### `mode`
Data type: `Enum['agent', 'bolt']`
@@ -801,7 +801,7 @@ Bolt
Default value: `'bolt'`
-##### `splunk_user`
+##### `splunk_user`
Data type: `String[1]`
@@ -809,18 +809,18 @@ Data type: `String[1]`
Default value: `$splunk::params::splunk_user`
-### `splunk::enterprise::service`
+### `splunk::enterprise::service`
Private class declared by Class[splunk::enterprise] to define a service
as its understood by Puppet using a dynamic set of data or platform specific
sub-classes
-### `splunk::enterprise::service::nix`
+### `splunk::enterprise::service::nix`
Private class declared by Class[splunk::enterprise::service] to provide
platform specific service management on Linux or Unix type systems.
-### `splunk::forwarder`
+### `splunk::forwarder`
Install and configure an instance of Splunk Universal Forwarder
@@ -849,48 +849,48 @@ class { 'splunk::forwarder':
The following parameters are available in the `splunk::forwarder` class:
-* [`server`](#server)
-* [`version`](#version)
-* [`package_name`](#package_name)
-* [`package_ensure`](#package_ensure)
-* [`staging_dir`](#staging_dir)
-* [`path_delimiter`](#path_delimiter)
-* [`forwarder_package_src`](#forwarder_package_src)
-* [`package_provider`](#package_provider)
-* [`manage_package_source`](#manage_package_source)
-* [`package_source`](#package_source)
-* [`install_options`](#install_options)
-* [`splunk_user`](#splunk_user)
-* [`forwarder_homedir`](#forwarder_homedir)
-* [`forwarder_confdir`](#forwarder_confdir)
-* [`service_name`](#service_name)
-* [`service_file`](#service_file)
-* [`boot_start`](#boot_start)
-* [`use_default_config`](#use_default_config)
-* [`splunkd_listen`](#splunkd_listen)
-* [`splunkd_port`](#splunkd_port)
-* [`logging_port`](#logging_port)
-* [`purge_inputs`](#purge_inputs)
-* [`purge_outputs`](#purge_outputs)
-* [`purge_props`](#purge_props)
-* [`purge_transforms`](#purge_transforms)
-* [`purge_web`](#purge_web)
-* [`forwarder_input`](#forwarder_input)
-* [`forwarder_output`](#forwarder_output)
-* [`manage_password`](#manage_password)
-* [`seed_password`](#seed_password)
-* [`reset_seeded_password`](#reset_seeded_password)
-* [`password_config_file`](#password_config_file)
-* [`seed_config_file`](#seed_config_file)
-* [`seed_user`](#seed_user)
-* [`password_content`](#password_content)
-* [`password_hash`](#password_hash)
-* [`secret_file`](#secret_file)
-* [`secret`](#secret)
-* [`addons`](#addons)
-* [`purge_deploymentclient`](#purge_deploymentclient)
-
-##### `server`
+* [`server`](#-splunk--forwarder--server)
+* [`version`](#-splunk--forwarder--version)
+* [`package_name`](#-splunk--forwarder--package_name)
+* [`package_ensure`](#-splunk--forwarder--package_ensure)
+* [`staging_dir`](#-splunk--forwarder--staging_dir)
+* [`path_delimiter`](#-splunk--forwarder--path_delimiter)
+* [`forwarder_package_src`](#-splunk--forwarder--forwarder_package_src)
+* [`package_provider`](#-splunk--forwarder--package_provider)
+* [`manage_package_source`](#-splunk--forwarder--manage_package_source)
+* [`package_source`](#-splunk--forwarder--package_source)
+* [`install_options`](#-splunk--forwarder--install_options)
+* [`splunk_user`](#-splunk--forwarder--splunk_user)
+* [`forwarder_homedir`](#-splunk--forwarder--forwarder_homedir)
+* [`forwarder_confdir`](#-splunk--forwarder--forwarder_confdir)
+* [`service_name`](#-splunk--forwarder--service_name)
+* [`service_file`](#-splunk--forwarder--service_file)
+* [`boot_start`](#-splunk--forwarder--boot_start)
+* [`use_default_config`](#-splunk--forwarder--use_default_config)
+* [`splunkd_listen`](#-splunk--forwarder--splunkd_listen)
+* [`splunkd_port`](#-splunk--forwarder--splunkd_port)
+* [`logging_port`](#-splunk--forwarder--logging_port)
+* [`purge_inputs`](#-splunk--forwarder--purge_inputs)
+* [`purge_outputs`](#-splunk--forwarder--purge_outputs)
+* [`purge_props`](#-splunk--forwarder--purge_props)
+* [`purge_transforms`](#-splunk--forwarder--purge_transforms)
+* [`purge_web`](#-splunk--forwarder--purge_web)
+* [`forwarder_input`](#-splunk--forwarder--forwarder_input)
+* [`forwarder_output`](#-splunk--forwarder--forwarder_output)
+* [`manage_password`](#-splunk--forwarder--manage_password)
+* [`seed_password`](#-splunk--forwarder--seed_password)
+* [`reset_seeded_password`](#-splunk--forwarder--reset_seeded_password)
+* [`password_config_file`](#-splunk--forwarder--password_config_file)
+* [`seed_config_file`](#-splunk--forwarder--seed_config_file)
+* [`seed_user`](#-splunk--forwarder--seed_user)
+* [`password_content`](#-splunk--forwarder--password_content)
+* [`password_hash`](#-splunk--forwarder--password_hash)
+* [`secret_file`](#-splunk--forwarder--secret_file)
+* [`secret`](#-splunk--forwarder--secret)
+* [`addons`](#-splunk--forwarder--addons)
+* [`purge_deploymentclient`](#-splunk--forwarder--purge_deploymentclient)
+
+##### `server`
Data type: `String[1]`
@@ -898,7 +898,7 @@ The fqdn or IP address of the Splunk server.
Default value: `$splunk::params::server`
-##### `version`
+##### `version`
Data type: `String[1]`
@@ -907,7 +907,7 @@ manage.
Default value: `$splunk::params::version`
-##### `package_name`
+##### `package_name`
Data type: `String[1]`
@@ -915,7 +915,7 @@ The name of the package(s) Puppet will use to install Splunk Forwarder.
Default value: `$splunk::params::forwarder_package_name`
-##### `package_ensure`
+##### `package_ensure`
Data type: `String[1]`
@@ -923,7 +923,7 @@ Ensure parameter which will get passed to the Splunk package resource.
Default value: `$splunk::params::forwarder_package_ensure`
-##### `staging_dir`
+##### `staging_dir`
Data type: `String[1]`
@@ -931,7 +931,7 @@ Root of the archive path to host the Splunk package.
Default value: `$splunk::params::staging_dir`
-##### `path_delimiter`
+##### `path_delimiter`
Data type: `String[1]`
@@ -939,7 +939,7 @@ The path separator used in the archived path of the Splunk package.
Default value: `$splunk::params::path_delimiter`
-##### `forwarder_package_src`
+##### `forwarder_package_src`
Data type: `String[1]`
@@ -951,7 +951,7 @@ a UNC path to the MSI.
Default value: `$splunk::params::forwarder_package_src`
-##### `package_provider`
+##### `package_provider`
Data type: `Optional[String[1]]`
@@ -959,15 +959,15 @@ The package management system used to host the Splunk packages.
Default value: `$splunk::params::package_provider`
-##### `manage_package_source`
+##### `manage_package_source`
Data type: `Boolean`
Whether or not to use the supplied `forwarder_package_src` param.
-Default value: ``true``
+Default value: `true`
-##### `package_source`
+##### `package_source`
Data type: `Optional[String[1]]`
@@ -977,9 +977,9 @@ MSI, etc). If `enterprise_package_src` parameter is set in splunk::params and
it is required. The URL can be of any protocol supported by the puppet/archive
module. On Windows, this can be a UNC path to the MSI.
-Default value: ``undef``
+Default value: `undef`
-##### `install_options`
+##### `install_options`
Data type: `Splunk::Fwdinstalloptions`
@@ -987,7 +987,7 @@ This variable is passed to the package resources' *install_options* parameter.
Default value: `$splunk::params::forwarder_install_options`
-##### `splunk_user`
+##### `splunk_user`
Data type: `String[1]`
@@ -995,7 +995,7 @@ The user to run Splunk as.
Default value: `$splunk::params::splunk_user`
-##### `forwarder_homedir`
+##### `forwarder_homedir`
Data type: `Stdlib::Absolutepath`
@@ -1003,7 +1003,7 @@ Specifies the Splunk Forwarder home directory.
Default value: `$splunk::params::forwarder_homedir`
-##### `forwarder_confdir`
+##### `forwarder_confdir`
Data type: `Stdlib::Absolutepath`
@@ -1011,7 +1011,7 @@ Specifies the Splunk Forwarder configuration directory.
Default value: `$splunk::params::forwarder_confdir`
-##### `service_name`
+##### `service_name`
Data type: `String[1]`
@@ -1019,7 +1019,7 @@ The name of the Splunk Forwarder service.
Default value: `$splunk::params::forwarder_service`
-##### `service_file`
+##### `service_file`
Data type: `Stdlib::Absolutepath`
@@ -1027,7 +1027,7 @@ The path to the Splunk Forwarder service file.
Default value: `$splunk::params::forwarder_service_file`
-##### `boot_start`
+##### `boot_start`
Data type: `Boolean`
@@ -1036,16 +1036,16 @@ manage the Splunk Forwarder service.
Default value: `$splunk::params::boot_start`
-##### `use_default_config`
+##### `use_default_config`
Data type: `Boolean`
Whether or not the module should manage a default set of Splunk Forwarder
configuration parameters.
-Default value: ``true``
+Default value: `true`
-##### `splunkd_listen`
+##### `splunkd_listen`
Data type: `Stdlib::IP::Address`
@@ -1053,7 +1053,7 @@ The address on which splunkd should listen.
Default value: `'127.0.0.1'`
-##### `splunkd_port`
+##### `splunkd_port`
Data type: `Stdlib::Port`
@@ -1061,7 +1061,7 @@ The management port for Splunk.
Default value: `$splunk::params::splunkd_port`
-##### `logging_port`
+##### `logging_port`
Data type: `Stdlib::Port`
@@ -1069,52 +1069,52 @@ The port on which to send and listen for logs.
Default value: `$splunk::params::logging_port`
-##### `purge_inputs`
+##### `purge_inputs`
Data type: `Boolean`
*Optional* If set to true, inputs.conf will be purged of configuration that is
no longer managed by the `splunkforwarder_input` type.
-Default value: ``false``
+Default value: `false`
-##### `purge_outputs`
+##### `purge_outputs`
Data type: `Boolean`
*Optional* If set to true, outputs.conf will be purged of configuration that is
no longer managed by the `splunk_output` type.
-Default value: ``false``
+Default value: `false`
-##### `purge_props`
+##### `purge_props`
Data type: `Boolean`
*Optional* If set to true, props.conf will be purged of configuration that is
no longer managed by the `splunk_props` type.
-Default value: ``false``
+Default value: `false`
-##### `purge_transforms`
+##### `purge_transforms`
Data type: `Boolean`
*Optional* If set to true, transforms.conf will be purged of configuration that is
no longer managed by the `splunk_transforms` type.
-Default value: ``false``
+Default value: `false`
-##### `purge_web`
+##### `purge_web`
Data type: `Boolean`
*Optional* If set to true, web.conf will be purged of configuration that is
no longer managed by the `splunk_web` type.
-Default value: ``false``
+Default value: `false`
-##### `forwarder_input`
+##### `forwarder_input`
Data type: `Hash`
@@ -1122,7 +1122,7 @@ Used to override the default `forwarder_input` type defined in splunk::params.
Default value: `$splunk::params::forwarder_input`
-##### `forwarder_output`
+##### `forwarder_output`
Data type: `Hash`
@@ -1130,7 +1130,7 @@ Used to override the default `forwarder_output` type defined in splunk::params.
Default value: `$splunk::params::forwarder_output`
-##### `manage_password`
+##### `manage_password`
Data type: `Boolean`
@@ -1138,7 +1138,7 @@ If set to true, Manage the contents of splunk.secret and passwd.
Default value: `$splunk::params::manage_password`
-##### `seed_password`
+##### `seed_password`
Data type: `Boolean`
@@ -1146,7 +1146,7 @@ If set to true, Manage the contents of splunk.secret and user-seed.conf.
Default value: `$splunk::params::seed_password`
-##### `reset_seeded_password`
+##### `reset_seeded_password`
Data type: `Boolean`
@@ -1155,7 +1155,7 @@ import process on restart of the Splunk services.
Default value: `$splunk::params::reset_seeded_password`
-##### `password_config_file`
+##### `password_config_file`
Data type: `Stdlib::Absolutepath`
@@ -1164,7 +1164,7 @@ Which file to put the password in i.e. in linux it would be
Default value: `$splunk::params::forwarder_password_config_file`
-##### `seed_config_file`
+##### `seed_config_file`
Data type: `Stdlib::Absolutepath`
@@ -1173,7 +1173,7 @@ restart.
Default value: `$splunk::params::forwarder_seed_config_file`
-##### `seed_user`
+##### `seed_user`
Data type: `String[1]`
@@ -1181,7 +1181,7 @@ The local user (usually 'admin') imported by Splunk.
Default value: `$splunk::params::seed_user`
-##### `password_content`
+##### `password_content`
Data type: `String[1]`
@@ -1189,7 +1189,7 @@ The hashed password username/details for the user.
Default value: `$splunk::params::password_content`
-##### `password_hash`
+##### `password_hash`
Data type: `String[1]`
@@ -1197,7 +1197,7 @@ The hashed password for the admin user.
Default value: `$splunk::params::password_hash`
-##### `secret_file`
+##### `secret_file`
Data type: `Stdlib::Absolutepath`
@@ -1205,7 +1205,7 @@ Which file we should put the secret in.
Default value: `$splunk::params::forwarder_secret_file`
-##### `secret`
+##### `secret`
Data type: `String[1]`
@@ -1213,7 +1213,7 @@ The secret used to salt the splunk password.
Default value: `$splunk::params::secret`
-##### `addons`
+##### `addons`
Data type: `Hash`
@@ -1221,27 +1221,27 @@ Manage a splunk addons, see `splunk::addons`.
Default value: `{}`
-##### `purge_deploymentclient`
+##### `purge_deploymentclient`
Data type: `Boolean`
-Default value: ``false``
+Default value: `false`
-### `splunk::forwarder::config`
+### `splunk::forwarder::config`
Private class declared by Class[splunk::forwarder] to contain all the
configuration needed for a base install of the Splunk Universal
Forwarder
-### `splunk::forwarder::install`
+### `splunk::forwarder::install`
Private class declared by Class[splunk::forwarder] to contain or define
through additional platform specific sub-class, the required steps
for successfully installing the Splunk Universal Forwarder
-### `splunk::forwarder::password::manage`
+### `splunk::forwarder::password::manage`
Implements the direct management of the Splunk Forwarder admin password
so it can be used outside of regular management of the whole stack to
@@ -1254,16 +1254,16 @@ used to manage admin password seeding.
The following parameters are available in the `splunk::forwarder::password::manage` class:
-* [`manage_password`](#manage_password)
-* [`password_config_file`](#password_config_file)
-* [`password_content`](#password_content)
-* [`secret_file`](#secret_file)
-* [`secret`](#secret)
-* [`service`](#service)
-* [`mode`](#mode)
-* [`splunk_user`](#splunk_user)
+* [`manage_password`](#-splunk--forwarder--password--manage--manage_password)
+* [`password_config_file`](#-splunk--forwarder--password--manage--password_config_file)
+* [`password_content`](#-splunk--forwarder--password--manage--password_content)
+* [`secret_file`](#-splunk--forwarder--password--manage--secret_file)
+* [`secret`](#-splunk--forwarder--password--manage--secret)
+* [`service`](#-splunk--forwarder--password--manage--service)
+* [`mode`](#-splunk--forwarder--password--manage--mode)
+* [`splunk_user`](#-splunk--forwarder--password--manage--splunk_user)
-##### `manage_password`
+##### `manage_password`
Data type: `Boolean`
@@ -1271,7 +1271,7 @@ If set to true, Manage the contents of splunk.secret and passwd.
Default value: `$splunk::params::manage_password`
-##### `password_config_file`
+##### `password_config_file`
Data type: `Stdlib::Absolutepath`
@@ -1280,7 +1280,7 @@ Which file to put the password in i.e. in linux it would be
Default value: `$splunk::params::enterprise_password_config_file`
-##### `password_content`
+##### `password_content`
Data type: `String[1]`
@@ -1288,7 +1288,7 @@ The hashed password username/details for the user.
Default value: `$splunk::params::password_content`
-##### `secret_file`
+##### `secret_file`
Data type: `Stdlib::Absolutepath`
@@ -1296,7 +1296,7 @@ Which file we should put the secret in.
Default value: `$splunk::params::enterprise_secret_file`
-##### `secret`
+##### `secret`
Data type: `String[1]`
@@ -1304,7 +1304,7 @@ The secret used to salt the splunk password.
Default value: `$splunk::params::secret`
-##### `service`
+##### `service`
Data type: `String[1]`
@@ -1313,7 +1313,7 @@ are updated, not applicable when running in agent mode.
Default value: `$splunk::params::forwarder_service`
-##### `mode`
+##### `mode`
Data type: `Enum['agent', 'bolt']`
@@ -1325,7 +1325,7 @@ Bolt
Default value: `'bolt'`
-##### `splunk_user`
+##### `splunk_user`
Data type: `String[1]`
@@ -1333,7 +1333,7 @@ Data type: `String[1]`
Default value: `$splunk::params::splunk_user`
-### `splunk::forwarder::password::seed`
+### `splunk::forwarder::password::seed`
Implements the seeding and reseeding of the Splunk Forwarder admin password
so it can be used outside of regular management of the whole stack to
@@ -1343,18 +1343,18 @@ facilitate admin password resets through Bolt Plans
The following parameters are available in the `splunk::forwarder::password::seed` class:
-* [`reset_seeded_password`](#reset_seeded_password)
-* [`password_config_file`](#password_config_file)
-* [`seed_config_file`](#seed_config_file)
-* [`seed_user`](#seed_user)
-* [`password_hash`](#password_hash)
-* [`secret_file`](#secret_file)
-* [`secret`](#secret)
-* [`service`](#service)
-* [`mode`](#mode)
-* [`splunk_user`](#splunk_user)
+* [`reset_seeded_password`](#-splunk--forwarder--password--seed--reset_seeded_password)
+* [`password_config_file`](#-splunk--forwarder--password--seed--password_config_file)
+* [`seed_config_file`](#-splunk--forwarder--password--seed--seed_config_file)
+* [`seed_user`](#-splunk--forwarder--password--seed--seed_user)
+* [`password_hash`](#-splunk--forwarder--password--seed--password_hash)
+* [`secret_file`](#-splunk--forwarder--password--seed--secret_file)
+* [`secret`](#-splunk--forwarder--password--seed--secret)
+* [`service`](#-splunk--forwarder--password--seed--service)
+* [`mode`](#-splunk--forwarder--password--seed--mode)
+* [`splunk_user`](#-splunk--forwarder--password--seed--splunk_user)
-##### `reset_seeded_password`
+##### `reset_seeded_password`
Data type: `Boolean`
@@ -1363,7 +1363,7 @@ import process on restart of the Splunk services.
Default value: `$splunk::params::reset_seeded_password`
-##### `password_config_file`
+##### `password_config_file`
Data type: `Stdlib::Absolutepath`
@@ -1372,7 +1372,7 @@ Which file to put the password in i.e. in linux it would be
Default value: `$splunk::params::forwarder_password_config_file`
-##### `seed_config_file`
+##### `seed_config_file`
Data type: `Stdlib::Absolutepath`
@@ -1381,7 +1381,7 @@ restart.
Default value: `$splunk::params::forwarder_seed_config_file`
-##### `seed_user`
+##### `seed_user`
Data type: `String[1]`
@@ -1389,7 +1389,7 @@ The local user (usually 'admin') imported by Splunk.
Default value: `$splunk::params::seed_user`
-##### `password_hash`
+##### `password_hash`
Data type: `String[1]`
@@ -1397,7 +1397,7 @@ The hashed password for the admin user.
Default value: `$splunk::params::password_hash`
-##### `secret_file`
+##### `secret_file`
Data type: `Stdlib::Absolutepath`
@@ -1405,7 +1405,7 @@ Which file we should put the secret in.
Default value: `$splunk::params::forwarder_secret_file`
-##### `secret`
+##### `secret`
Data type: `String[1]`
@@ -1413,7 +1413,7 @@ The secret used to salt the splunk password.
Default value: `$splunk::params::secret`
-##### `service`
+##### `service`
Data type: `String[1]`
@@ -1422,7 +1422,7 @@ are updated, not applicable when running in agent mode.
Default value: `$splunk::params::forwarder_service`
-##### `mode`
+##### `mode`
Data type: `Enum['agent', 'bolt']`
@@ -1434,7 +1434,7 @@ Bolt
Default value: `'bolt'`
-##### `splunk_user`
+##### `splunk_user`
Data type: `String[1]`
@@ -1442,18 +1442,18 @@ Data type: `String[1]`
Default value: `$splunk::params::splunk_user`
-### `splunk::forwarder::service`
+### `splunk::forwarder::service`
Private class declared by Class[splunk::forwarder] to define a service as
its understood by Puppet using a dynamic set of data or platform specific
sub-classes
-### `splunk::forwarder::service::nix`
+### `splunk::forwarder::service::nix`
Private class declared by Class[splunk::forwarder::service] to provide
platform specific service management on Linux or Unix type systems.
-### `splunk::params`
+### `splunk::params`
This class takes a small number of arguments (can be set through Hiera) and
generates sane default values installation media names and locations.
@@ -1465,20 +1465,20 @@ parameters to be consumed by child classes.
The following parameters are available in the `splunk::params` class:
-* [`version`](#version)
-* [`build`](#build)
-* [`splunkd_port`](#splunkd_port)
-* [`logging_port`](#logging_port)
-* [`server`](#server)
-* [`splunk_user`](#splunk_user)
-* [`src_root`](#src_root)
-* [`boot_start`](#boot_start)
-* [`forwarder_installdir`](#forwarder_installdir)
-* [`enterprise_installdir`](#enterprise_installdir)
-* [`default_host`](#default_host)
-* [`manage_net_tools`](#manage_net_tools)
-
-##### `version`
+* [`version`](#-splunk--params--version)
+* [`build`](#-splunk--params--build)
+* [`splunkd_port`](#-splunk--params--splunkd_port)
+* [`logging_port`](#-splunk--params--logging_port)
+* [`server`](#-splunk--params--server)
+* [`splunk_user`](#-splunk--params--splunk_user)
+* [`src_root`](#-splunk--params--src_root)
+* [`boot_start`](#-splunk--params--boot_start)
+* [`forwarder_installdir`](#-splunk--params--forwarder_installdir)
+* [`enterprise_installdir`](#-splunk--params--enterprise_installdir)
+* [`default_host`](#-splunk--params--default_host)
+* [`manage_net_tools`](#-splunk--params--manage_net_tools)
+
+##### `version`
Data type: `String[1]`
@@ -1487,7 +1487,7 @@ The version of Splunk to install. This will be in the form x.y.z; e.g.
Default value: `'7.2.4.2'`
-##### `build`
+##### `build`
Data type: `String[1]`
@@ -1499,7 +1499,7 @@ e.g. "123586".
Default value: `'fb30470262e3'`
-##### `splunkd_port`
+##### `splunkd_port`
Data type: `Stdlib::Port`
@@ -1507,7 +1507,7 @@ The splunkd port.
Default value: `8089`
-##### `logging_port`
+##### `logging_port`
Data type: `Stdlib::Port`
@@ -1515,7 +1515,7 @@ The port on which to send logs, and listen for logs.
Default value: `9997`
-##### `server`
+##### `server`
Data type: `String[1]`
@@ -1524,15 +1524,21 @@ the default TCP output and input.
Default value: `'splunk'`
-##### `splunk_user`
+##### `splunk_user`
Data type: `String[1]`
The user that splunk runs as.
-Default value: `$facts['os']['family']`
+Default value:
-##### `src_root`
+```puppet
+$facts['os']['family'] ? {
+ 'windows' => 'Administrator',
+ default => 'root'
+```
+
+##### `src_root`
Data type: `String[1]`
@@ -1585,7 +1591,7 @@ $root_url/
Default value: `'https://download.splunk.com'`
-##### `boot_start`
+##### `boot_start`
Data type: `Boolean`
@@ -1594,25 +1600,25 @@ Enable Splunk to start at boot, create a system service file.
WARNING: Toggling `boot_start` from `false` to `true` will cause a restart of
Splunk Enterprise and Forwarder services.
-Default value: ``true``
+Default value: `true`
-##### `forwarder_installdir`
+##### `forwarder_installdir`
Data type: `Optional[String[1]]`
Optional directory in which to install and manage Splunk Forwarder
-Default value: ``undef``
+Default value: `undef`
-##### `enterprise_installdir`
+##### `enterprise_installdir`
Data type: `Optional[String[1]]`
Optional directory in which to install and manage Splunk Enterprise
-Default value: ``undef``
+Default value: `undef`
-##### `default_host`
+##### `default_host`
Data type: `String[1]`
@@ -1620,7 +1626,7 @@ The host property in inputs.conf. Defaults to the server's hostname.
Default value: `$facts['clientcert']`
-##### `manage_net_tools`
+##### `manage_net_tools`
Data type: `Boolean`
@@ -1628,11 +1634,11 @@ From Splunk 7.2.2+ the package `net-tools` is required to be installed on the sy
By default this module manages the resource Package[net-tools], if this resource is
already declared on your code base, you can disable this flag.
-Default value: ``true``
+Default value: `true`
## Defined types
-### `splunk::addon`
+### `splunk::addon`
Defined type for deploying Splunk Add-ons and Apps from either OS packages
or via splunkbase compatible archives
@@ -1667,55 +1673,55 @@ splunk::addon { 'Splunk_TA_nix':
The following parameters are available in the `splunk::addon` defined type:
-* [`splunk_home`](#splunk_home)
-* [`package_manage`](#package_manage)
-* [`splunkbase_source`](#splunkbase_source)
-* [`extract_command`](#extract_command)
-* [`package_name`](#package_name)
-* [`owner`](#owner)
-* [`inputs`](#inputs)
+* [`splunk_home`](#-splunk--addon--splunk_home)
+* [`package_manage`](#-splunk--addon--package_manage)
+* [`splunkbase_source`](#-splunk--addon--splunkbase_source)
+* [`extract_command`](#-splunk--addon--extract_command)
+* [`package_name`](#-splunk--addon--package_name)
+* [`owner`](#-splunk--addon--owner)
+* [`inputs`](#-splunk--addon--inputs)
-##### `splunk_home`
+##### `splunk_home`
Data type: `Optional[Stdlib::Absolutepath]`
Overrides the default Splunk installation target values from Class[splunk::params]
-Default value: ``undef``
+Default value: `undef`
-##### `package_manage`
+##### `package_manage`
Data type: `Boolean`
If a package should be installed as part of declaring a new instance of Splunk::Addon
-Default value: ``true``
+Default value: `true`
-##### `splunkbase_source`
+##### `splunkbase_source`
Data type: `Optional[String[1]]`
When set the add-on will be installed from a splunkbase compatible archive instead of OS packages
-Default value: ``undef``
+Default value: `undef`
-##### `extract_command`
+##### `extract_command`
Data type: `Optional[String[1]]`
A 'extract_command' to pass to the 'archive' that extracts a splunkbase_source package (helpful for SPL files)
-Default value: ``undef``
+Default value: `undef`
-##### `package_name`
+##### `package_name`
Data type: `Optional[String[1]]`
The OS package to install if you are not installing via splunk compatible archive
-Default value: ``undef``
+Default value: `undef`
-##### `owner`
+##### `owner`
Data type: `String[1]`
@@ -1723,7 +1729,7 @@ The user that files are owned by when they are created as part of add-on install
Default value: `'splunk'`
-##### `inputs`
+##### `inputs`
Data type: `Hash`
@@ -1741,9 +1747,9 @@ Manage splunk alert_actions settings in alert_actions.conf
The following parameters are available in the `splunk_alert_actions` type.
-* [`provider`](#provider)
+* [`provider`](#-splunk_alert_actions--provider)
-##### `provider`
+##### `provider`
The specific backend to use for this `splunk_alert_actions` resource. You will seldom need to specify this --- Puppet
will usually discover the appropriate provider for your platform.
@@ -1756,9 +1762,9 @@ Manage splunk authentication settings in authentication.conf
The following parameters are available in the `splunk_authentication` type.
-* [`provider`](#provider)
+* [`provider`](#-splunk_authentication--provider)
-##### `provider`
+##### `provider`
The specific backend to use for this `splunk_authentication` resource. You will seldom need to specify this --- Puppet
will usually discover the appropriate provider for your platform.
@@ -1771,9 +1777,9 @@ Manage splunk authorize settings in authorize.conf
The following parameters are available in the `splunk_authorize` type.
-* [`provider`](#provider)
+* [`provider`](#-splunk_authorize--provider)
-##### `provider`
+##### `provider`
The specific backend to use for this `splunk_authorize` resource. You will seldom need to specify this --- Puppet will
usually discover the appropriate provider for your platform.
@@ -1786,28 +1792,28 @@ splunk config
The following parameters are available in the `splunk_config` type.
-* [`forwarder_confdir`](#forwarder_confdir)
-* [`forwarder_installdir`](#forwarder_installdir)
-* [`name`](#name)
-* [`server_confdir`](#server_confdir)
-* [`server_installdir`](#server_installdir)
+* [`forwarder_confdir`](#-splunk_config--forwarder_confdir)
+* [`forwarder_installdir`](#-splunk_config--forwarder_installdir)
+* [`name`](#-splunk_config--name)
+* [`server_confdir`](#-splunk_config--server_confdir)
+* [`server_installdir`](#-splunk_config--server_installdir)
-##### `forwarder_confdir`
+##### `forwarder_confdir`
-##### `forwarder_installdir`
+##### `forwarder_installdir`
-##### `name`
+##### `name`
namevar
splunk config
-##### `server_confdir`
+##### `server_confdir`
-##### `server_installdir`
+##### `server_installdir`
### `splunk_deploymentclient`
@@ -1818,9 +1824,9 @@ Manage splunk deploymentclient entries in deploymentclient.conf
The following parameters are available in the `splunk_deploymentclient` type.
-* [`provider`](#provider)
+* [`provider`](#-splunk_deploymentclient--provider)
-##### `provider`
+##### `provider`
The specific backend to use for this `splunk_deploymentclient` resource. You will seldom need to specify this --- Puppet
will usually discover the appropriate provider for your platform.
@@ -1833,9 +1839,9 @@ Manage distsearch entries in distsearch.conf
The following parameters are available in the `splunk_distsearch` type.
-* [`provider`](#provider)
+* [`provider`](#-splunk_distsearch--provider)
-##### `provider`
+##### `provider`
The specific backend to use for this `splunk_distsearch` resource. You will seldom need to specify this --- Puppet will
usually discover the appropriate provider for your platform.
@@ -1848,9 +1854,9 @@ Manage splunk index settings in indexes.conf
The following parameters are available in the `splunk_indexes` type.
-* [`provider`](#provider)
+* [`provider`](#-splunk_indexes--provider)
-##### `provider`
+##### `provider`
The specific backend to use for this `splunk_indexes` resource. You will seldom need to specify this --- Puppet will
usually discover the appropriate provider for your platform.
@@ -1863,9 +1869,9 @@ Manage splunk input settings in inputs.conf
The following parameters are available in the `splunk_input` type.
-* [`provider`](#provider)
+* [`provider`](#-splunk_input--provider)
-##### `provider`
+##### `provider`
The specific backend to use for this `splunk_input` resource. You will seldom need to specify this --- Puppet will
usually discover the appropriate provider for your platform.
@@ -1878,9 +1884,9 @@ Manage splunk limits settings in limits.conf
The following parameters are available in the `splunk_limits` type.
-* [`provider`](#provider)
+* [`provider`](#-splunk_limits--provider)
-##### `provider`
+##### `provider`
The specific backend to use for this `splunk_limits` resource. You will seldom need to specify this --- Puppet will
usually discover the appropriate provider for your platform.
@@ -1893,9 +1899,9 @@ Manage metadata entries in {default,local}.meta
The following parameters are available in the `splunk_metadata` type.
-* [`provider`](#provider)
+* [`provider`](#-splunk_metadata--provider)
-##### `provider`
+##### `provider`
The specific backend to use for this `splunk_metadata` resource. You will seldom need to specify this --- Puppet will
usually discover the appropriate provider for your platform.
@@ -1908,9 +1914,9 @@ Manage splunk output settings in outputs.conf
The following parameters are available in the `splunk_output` type.
-* [`provider`](#provider)
+* [`provider`](#-splunk_output--provider)
-##### `provider`
+##### `provider`
The specific backend to use for this `splunk_output` resource. You will seldom need to specify this --- Puppet will
usually discover the appropriate provider for your platform.
@@ -1923,9 +1929,9 @@ Manage splunk prop settings in props.conf
The following parameters are available in the `splunk_props` type.
-* [`provider`](#provider)
+* [`provider`](#-splunk_props--provider)
-##### `provider`
+##### `provider`
The specific backend to use for this `splunk_props` resource. You will seldom need to specify this --- Puppet will
usually discover the appropriate provider for your platform.
@@ -1938,9 +1944,9 @@ Manage splunk server settings in server.conf
The following parameters are available in the `splunk_server` type.
-* [`provider`](#provider)
+* [`provider`](#-splunk_server--provider)
-##### `provider`
+##### `provider`
The specific backend to use for this `splunk_server` resource. You will seldom need to specify this --- Puppet will
usually discover the appropriate provider for your platform.
@@ -1953,9 +1959,9 @@ Manage splunk serverclass entries in serverclass.conf
The following parameters are available in the `splunk_serverclass` type.
-* [`provider`](#provider)
+* [`provider`](#-splunk_serverclass--provider)
-##### `provider`
+##### `provider`
The specific backend to use for this `splunk_serverclass` resource. You will seldom need to specify this --- Puppet will
usually discover the appropriate provider for your platform.
@@ -1968,9 +1974,9 @@ Manage splunk transforms settings in transforms.conf
The following parameters are available in the `splunk_transforms` type.
-* [`provider`](#provider)
+* [`provider`](#-splunk_transforms--provider)
-##### `provider`
+##### `provider`
The specific backend to use for this `splunk_transforms` resource. You will seldom need to specify this --- Puppet will
usually discover the appropriate provider for your platform.
@@ -1983,9 +1989,9 @@ Manage splunk web ui settings in ui-prefs.conf
The following parameters are available in the `splunk_uiprefs` type.
-* [`provider`](#provider)
+* [`provider`](#-splunk_uiprefs--provider)
-##### `provider`
+##### `provider`
The specific backend to use for this `splunk_uiprefs` resource. You will seldom need to specify this --- Puppet will
usually discover the appropriate provider for your platform.
@@ -1998,9 +2004,9 @@ Manage splunk web settings in web.conf
The following parameters are available in the `splunk_web` type.
-* [`provider`](#provider)
+* [`provider`](#-splunk_web--provider)
-##### `provider`
+##### `provider`
The specific backend to use for this `splunk_web` resource. You will seldom need to specify this --- Puppet will usually
discover the appropriate provider for your platform.
@@ -2013,9 +2019,9 @@ Manage splunkforwarder deploymentclient entries in deploymentclient.conf
The following parameters are available in the `splunkforwarder_deploymentclient` type.
-* [`provider`](#provider)
+* [`provider`](#-splunkforwarder_deploymentclient--provider)
-##### `provider`
+##### `provider`
The specific backend to use for this `splunkforwarder_deploymentclient` resource. You will seldom need to specify this
--- Puppet will usually discover the appropriate provider for your platform.
@@ -2028,9 +2034,9 @@ Manage splunkforwarder input settings in inputs.conf
The following parameters are available in the `splunkforwarder_input` type.
-* [`provider`](#provider)
+* [`provider`](#-splunkforwarder_input--provider)
-##### `provider`
+##### `provider`
The specific backend to use for this `splunkforwarder_input` resource. You will seldom need to specify this --- Puppet
will usually discover the appropriate provider for your platform.
@@ -2043,9 +2049,9 @@ Manage splunkforwarder limit settings in limits.conf
The following parameters are available in the `splunkforwarder_limits` type.
-* [`provider`](#provider)
+* [`provider`](#-splunkforwarder_limits--provider)
-##### `provider`
+##### `provider`
The specific backend to use for this `splunkforwarder_limits` resource. You will seldom need to specify this --- Puppet
will usually discover the appropriate provider for your platform.
@@ -2058,9 +2064,9 @@ Manage splunkforwarder output settings in outputs.conf
The following parameters are available in the `splunkforwarder_output` type.
-* [`provider`](#provider)
+* [`provider`](#-splunkforwarder_output--provider)
-##### `provider`
+##### `provider`
The specific backend to use for this `splunkforwarder_output` resource. You will seldom need to specify this --- Puppet
will usually discover the appropriate provider for your platform.
@@ -2073,9 +2079,9 @@ Manage splunkforwarder props settings in props.conf
The following parameters are available in the `splunkforwarder_props` type.
-* [`provider`](#provider)
+* [`provider`](#-splunkforwarder_props--provider)
-##### `provider`
+##### `provider`
The specific backend to use for this `splunkforwarder_props` resource. You will seldom need to specify this --- Puppet
will usually discover the appropriate provider for your platform.
@@ -2088,9 +2094,9 @@ Manage splunkforwarder server settings in server.conf
The following parameters are available in the `splunkforwarder_server` type.
-* [`provider`](#provider)
+* [`provider`](#-splunkforwarder_server--provider)
-##### `provider`
+##### `provider`
The specific backend to use for this `splunkforwarder_server` resource. You will seldom need to specify this --- Puppet
will usually discover the appropriate provider for your platform.
@@ -2103,9 +2109,9 @@ Manage splunkforwarder transforms settings in transforms.conf
The following parameters are available in the `splunkforwarder_transforms` type.
-* [`provider`](#provider)
+* [`provider`](#-splunkforwarder_transforms--provider)
-##### `provider`
+##### `provider`
The specific backend to use for this `splunkforwarder_transforms` resource. You will seldom need to specify this ---
Puppet will usually discover the appropriate provider for your platform.
@@ -2118,32 +2124,24 @@ Manage splunkforwarder web settings in web.conf
The following parameters are available in the `splunkforwarder_web` type.
-* [`provider`](#provider)
+* [`provider`](#-splunkforwarder_web--provider)
-##### `provider`
+##### `provider`
The specific backend to use for this `splunkforwarder_web` resource. You will seldom need to specify this --- Puppet
will usually discover the appropriate provider for your platform.
## Data types
-### `Splunk::Entinstalloptions`
+### `Splunk::Entinstalloptions`
The Splunk::Entinstalloptions data type.
-Alias of
+Alias of `Variant[Tuple[Hash,Hash,String,3,default], Array[String[1]]]`
-```puppet
-Variant[Tuple[Hash,Hash,String,3,default], Array[String[1]]]
-```
-
-### `Splunk::Fwdinstalloptions`
+### `Splunk::Fwdinstalloptions`
The Splunk::Fwdinstalloptions data type.
-Alias of
-
-```puppet
-Variant[Tuple[Hash,String,1,default], Array[String[1]]]
-```
+Alias of `Variant[Tuple[Hash,String,1,default], Array[String[1]]]`
diff --git a/Rakefile b/Rakefile
index 80b799d6..10e26e73 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,7 +1,7 @@
# Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
-# Attempt to load voxupuli-test (which pulls in puppetlabs_spec_helper),
+# Attempt to load voxpupuli-test (which pulls in puppetlabs_spec_helper),
# otherwise attempt to load it directly.
begin
require 'voxpupuli/test/rake'
@@ -24,6 +24,10 @@ end
begin
require 'voxpupuli/release/rake_tasks'
rescue LoadError
+ # voxpupuli-release not present
+else
+ GCGConfig.user = 'voxpupuli'
+ GCGConfig.project = 'puppet-splunk'
end
desc "Run main 'test' task and report merged results to coveralls"
@@ -37,36 +41,4 @@ task test_with_coveralls: [:test] do
end
end
-desc 'Generate REFERENCE.md'
-task :reference, [:debug, :backtrace] do |t, args|
- patterns = ''
- Rake::Task['strings:generate:reference'].invoke(patterns, args[:debug], args[:backtrace])
-end
-
-begin
- require 'github_changelog_generator/task'
- require 'puppet_blacksmith'
- GitHubChangelogGenerator::RakeTask.new :changelog do |config|
- metadata = Blacksmith::Modulefile.new
- config.future_release = "v#{metadata.version}" if metadata.version =~ /^\d+\.\d+.\d+$/
- config.header = "# Changelog\n\nAll notable changes to this project will be documented in this file.\nEach new release typically also includes the latest modulesync defaults.\nThese should not affect the functionality of the module."
- config.exclude_labels = %w{duplicate question invalid wontfix wont-fix modulesync skip-changelog}
- config.user = 'voxpupuli'
- config.project = metadata.metadata['name']
- end
-
- # Workaround for https://github.com/github-changelog-generator/github-changelog-generator/issues/715
- require 'rbconfig'
- if RbConfig::CONFIG['host_os'] =~ /linux/
- task :changelog do
- puts 'Fixing line endings...'
- changelog_file = File.join(__dir__, 'CHANGELOG.md')
- changelog_txt = File.read(changelog_file)
- new_contents = changelog_txt.gsub(%r{\r\n}, "\n")
- File.open(changelog_file, "w") {|file| file.puts new_contents }
- end
- end
-
-rescue LoadError
-end
# vim: syntax=ruby
diff --git a/lib/facter/splunk_version.rb b/lib/facter/splunk_version.rb
index 515d344c..747f9ddb 100755
--- a/lib/facter/splunk_version.rb
+++ b/lib/facter/splunk_version.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Facter.add(:splunk_version) do
setcode do
value = nil
@@ -8,7 +10,7 @@
end
if cmd
output = Facter::Util::Resolution.exec(cmd)
- if output =~ %r{^Splunk ([0-9\.]+) \(} # rubocop:disable Style/IfUnlessModifier
+ if output =~ %r{^Splunk ([0-9.]+) \(} # rubocop:disable Style/IfUnlessModifier
value = Regexp.last_match(1)
end
end
diff --git a/lib/facter/splunkforwarder_version.rb b/lib/facter/splunkforwarder_version.rb
index 7732148b..fd3e7fbe 100755
--- a/lib/facter/splunkforwarder_version.rb
+++ b/lib/facter/splunkforwarder_version.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Facter.add(:splunkforwarder_version) do
setcode do
value = nil
@@ -8,9 +10,7 @@
end
if cmd
output = Facter::Util::Resolution.exec(cmd)
- if output =~ %r{^Splunk Universal Forwarder ([0-9\.]+) \(}
- value = Regexp.last_match(1)
- end
+ value = Regexp.last_match(1) if output =~ %r{^Splunk Universal Forwarder ([0-9.]+) \(}
end
value
end
diff --git a/lib/puppet/provider/ini_setting/splunk.rb b/lib/puppet/provider/ini_setting/splunk.rb
index 04c802fe..d04c3ea5 100644
--- a/lib/puppet/provider/ini_setting/splunk.rb
+++ b/lib/puppet/provider/ini_setting/splunk.rb
@@ -1,8 +1,9 @@
+# frozen_string_literal: true
+
Puppet::Type.type(:ini_setting).provide(
:splunk,
parent: Puppet::Type.type(:ini_setting).provider(:ruby)
) do
-
confine true: false # Never automatically select this provider
@file_path = nil
@@ -14,6 +15,7 @@ class << self
def self.file_path
raise Puppet::Error, 'file_path must be set with splunkenterprise_config or splunkforwarder_config type before provider can be used' if @file_path.nil?
raise Puppet::Error, 'Child provider class does not support a file_name method' unless respond_to?(:file_name)
+
@file_path
end
diff --git a/lib/puppet/provider/splunk_alert_actions/ini_setting.rb b/lib/puppet/provider/splunk_alert_actions/ini_setting.rb
index 21899697..965f89a0 100644
--- a/lib/puppet/provider/splunk_alert_actions/ini_setting.rb
+++ b/lib/puppet/provider/splunk_alert_actions/ini_setting.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Puppet::Type.type(:splunk_alert_actions).provide(
:ini_setting,
parent: Puppet::Type.type(:ini_setting).provider(:splunk)
diff --git a/lib/puppet/provider/splunk_authentication/ini_setting.rb b/lib/puppet/provider/splunk_authentication/ini_setting.rb
index 4767564a..afbfe029 100644
--- a/lib/puppet/provider/splunk_authentication/ini_setting.rb
+++ b/lib/puppet/provider/splunk_authentication/ini_setting.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Puppet::Type.type(:splunk_authentication).provide(
:ini_setting,
parent: Puppet::Type.type(:ini_setting).provider(:splunk)
diff --git a/lib/puppet/provider/splunk_authorize/ini_setting.rb b/lib/puppet/provider/splunk_authorize/ini_setting.rb
index 104b8f50..3371e02a 100644
--- a/lib/puppet/provider/splunk_authorize/ini_setting.rb
+++ b/lib/puppet/provider/splunk_authorize/ini_setting.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Puppet::Type.type(:splunk_authorize).provide(
:ini_setting,
parent: Puppet::Type.type(:ini_setting).provider(:splunk)
diff --git a/lib/puppet/provider/splunk_deploymentclient/ini_setting.rb b/lib/puppet/provider/splunk_deploymentclient/ini_setting.rb
index 90bf9c25..9d5ecec2 100644
--- a/lib/puppet/provider/splunk_deploymentclient/ini_setting.rb
+++ b/lib/puppet/provider/splunk_deploymentclient/ini_setting.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Puppet::Type.type(:splunk_deploymentclient).provide(
:ini_setting,
parent: Puppet::Type.type(:ini_setting).provider(:splunk)
diff --git a/lib/puppet/provider/splunk_distsearch/ini_setting.rb b/lib/puppet/provider/splunk_distsearch/ini_setting.rb
index e9ee9cf5..e04e5fa5 100644
--- a/lib/puppet/provider/splunk_distsearch/ini_setting.rb
+++ b/lib/puppet/provider/splunk_distsearch/ini_setting.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Puppet::Type.type(:splunk_distsearch).provide(
:ini_setting,
parent: Puppet::Type.type(:ini_setting).provider(:splunk)
diff --git a/lib/puppet/provider/splunk_indexes/ini_setting.rb b/lib/puppet/provider/splunk_indexes/ini_setting.rb
index edeefdc7..46e8dfad 100644
--- a/lib/puppet/provider/splunk_indexes/ini_setting.rb
+++ b/lib/puppet/provider/splunk_indexes/ini_setting.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Puppet::Type.type(:splunk_indexes).provide(
:ini_setting,
parent: Puppet::Type.type(:ini_setting).provider(:splunk)
diff --git a/lib/puppet/provider/splunk_input/ini_setting.rb b/lib/puppet/provider/splunk_input/ini_setting.rb
index b8203404..6119c40e 100644
--- a/lib/puppet/provider/splunk_input/ini_setting.rb
+++ b/lib/puppet/provider/splunk_input/ini_setting.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Puppet::Type.type(:splunk_input).provide(
:ini_setting,
parent: Puppet::Type.type(:ini_setting).provider(:splunk)
diff --git a/lib/puppet/provider/splunk_limits/ini_setting.rb b/lib/puppet/provider/splunk_limits/ini_setting.rb
index 2b1ea79f..552908ae 100644
--- a/lib/puppet/provider/splunk_limits/ini_setting.rb
+++ b/lib/puppet/provider/splunk_limits/ini_setting.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Puppet::Type.type(:splunk_limits).provide(
:ini_setting,
parent: Puppet::Type.type(:ini_setting).provider(:splunk)
diff --git a/lib/puppet/provider/splunk_metadata/ini_setting.rb b/lib/puppet/provider/splunk_metadata/ini_setting.rb
index d96cbbd9..8453ff76 100644
--- a/lib/puppet/provider/splunk_metadata/ini_setting.rb
+++ b/lib/puppet/provider/splunk_metadata/ini_setting.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'puppet/util/ini_file'
class SectionNoGlobal < Puppet::Util::IniFile::Section
@@ -44,7 +46,7 @@ def file_path
# {app/foo,system}/{default,local} -> {app/foo,system}/metadata/{default,local}.meta
ctxelem = File.split(context)
if %w[local default].include?(ctxelem[-1])
- file_name = ctxelem[-1] + '.meta'
+ file_name = "#{ctxelem[-1]}.meta"
context = File.join(ctxelem[0..-2], 'metadata')
end
diff --git a/lib/puppet/provider/splunk_output/ini_setting.rb b/lib/puppet/provider/splunk_output/ini_setting.rb
index f5959686..1ff7e758 100644
--- a/lib/puppet/provider/splunk_output/ini_setting.rb
+++ b/lib/puppet/provider/splunk_output/ini_setting.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Puppet::Type.type(:splunk_output).provide(
:ini_setting,
parent: Puppet::Type.type(:ini_setting).provider(:splunk)
diff --git a/lib/puppet/provider/splunk_props/ini_setting.rb b/lib/puppet/provider/splunk_props/ini_setting.rb
index 86edd22c..2fc65f11 100644
--- a/lib/puppet/provider/splunk_props/ini_setting.rb
+++ b/lib/puppet/provider/splunk_props/ini_setting.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Puppet::Type.type(:splunk_props).provide(
:ini_setting,
parent: Puppet::Type.type(:ini_setting).provider(:splunk)
diff --git a/lib/puppet/provider/splunk_server/ini_setting.rb b/lib/puppet/provider/splunk_server/ini_setting.rb
index 43c12205..4beab3f0 100644
--- a/lib/puppet/provider/splunk_server/ini_setting.rb
+++ b/lib/puppet/provider/splunk_server/ini_setting.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Puppet::Type.type(:splunk_server).provide(
:ini_setting,
parent: Puppet::Type.type(:ini_setting).provider(:splunk)
diff --git a/lib/puppet/provider/splunk_serverclass/ini_setting.rb b/lib/puppet/provider/splunk_serverclass/ini_setting.rb
index 17996045..1954b9d1 100644
--- a/lib/puppet/provider/splunk_serverclass/ini_setting.rb
+++ b/lib/puppet/provider/splunk_serverclass/ini_setting.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Puppet::Type.type(:splunk_serverclass).provide(
:ini_setting,
parent: Puppet::Type.type(:ini_setting).provider(:splunk)
diff --git a/lib/puppet/provider/splunk_transforms/ini_setting.rb b/lib/puppet/provider/splunk_transforms/ini_setting.rb
index 1dc0086a..87eed3df 100644
--- a/lib/puppet/provider/splunk_transforms/ini_setting.rb
+++ b/lib/puppet/provider/splunk_transforms/ini_setting.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Puppet::Type.type(:splunk_transforms).provide(
:ini_setting,
parent: Puppet::Type.type(:ini_setting).provider(:splunk)
diff --git a/lib/puppet/provider/splunk_uiprefs/ini_setting.rb b/lib/puppet/provider/splunk_uiprefs/ini_setting.rb
index 1430dfa7..e7166e14 100644
--- a/lib/puppet/provider/splunk_uiprefs/ini_setting.rb
+++ b/lib/puppet/provider/splunk_uiprefs/ini_setting.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Puppet::Type.type(:splunk_uiprefs).provide(
:ini_setting,
parent: Puppet::Type.type(:ini_setting).provider(:splunk)
diff --git a/lib/puppet/provider/splunk_web/ini_setting.rb b/lib/puppet/provider/splunk_web/ini_setting.rb
index f70f7f3c..a24c2cb9 100644
--- a/lib/puppet/provider/splunk_web/ini_setting.rb
+++ b/lib/puppet/provider/splunk_web/ini_setting.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Puppet::Type.type(:splunk_web).provide(
:ini_setting,
parent: Puppet::Type.type(:ini_setting).provider(:splunk)
diff --git a/lib/puppet/provider/splunkforwarder_deploymentclient/ini_setting.rb b/lib/puppet/provider/splunkforwarder_deploymentclient/ini_setting.rb
index c8470622..1a202b3f 100644
--- a/lib/puppet/provider/splunkforwarder_deploymentclient/ini_setting.rb
+++ b/lib/puppet/provider/splunkforwarder_deploymentclient/ini_setting.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Puppet::Type.type(:splunkforwarder_deploymentclient).provide(
:ini_setting,
parent: Puppet::Type.type(:ini_setting).provider(:splunk)
diff --git a/lib/puppet/provider/splunkforwarder_input/ini_setting.rb b/lib/puppet/provider/splunkforwarder_input/ini_setting.rb
index 74fabd8f..110b000d 100644
--- a/lib/puppet/provider/splunkforwarder_input/ini_setting.rb
+++ b/lib/puppet/provider/splunkforwarder_input/ini_setting.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Puppet::Type.type(:splunkforwarder_input).provide(
:ini_setting,
parent: Puppet::Type.type(:ini_setting).provider(:splunk)
diff --git a/lib/puppet/provider/splunkforwarder_limits/ini_setting.rb b/lib/puppet/provider/splunkforwarder_limits/ini_setting.rb
index 42c3e731..7d2c8fa4 100644
--- a/lib/puppet/provider/splunkforwarder_limits/ini_setting.rb
+++ b/lib/puppet/provider/splunkforwarder_limits/ini_setting.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Puppet::Type.type(:splunkforwarder_limits).provide(
:ini_setting,
parent: Puppet::Type.type(:ini_setting).provider(:splunk)
diff --git a/lib/puppet/provider/splunkforwarder_output/ini_setting.rb b/lib/puppet/provider/splunkforwarder_output/ini_setting.rb
index ae46e175..3df85802 100644
--- a/lib/puppet/provider/splunkforwarder_output/ini_setting.rb
+++ b/lib/puppet/provider/splunkforwarder_output/ini_setting.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Puppet::Type.type(:splunkforwarder_output).provide(
:ini_setting,
parent: Puppet::Type.type(:ini_setting).provider(:splunk)
diff --git a/lib/puppet/provider/splunkforwarder_props/ini_setting.rb b/lib/puppet/provider/splunkforwarder_props/ini_setting.rb
index d8cb0558..19fb45c1 100644
--- a/lib/puppet/provider/splunkforwarder_props/ini_setting.rb
+++ b/lib/puppet/provider/splunkforwarder_props/ini_setting.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Puppet::Type.type(:splunkforwarder_props).provide(
:ini_setting,
parent: Puppet::Type.type(:ini_setting).provider(:splunk)
diff --git a/lib/puppet/provider/splunkforwarder_server/ini_setting.rb b/lib/puppet/provider/splunkforwarder_server/ini_setting.rb
index 88917452..a544a614 100644
--- a/lib/puppet/provider/splunkforwarder_server/ini_setting.rb
+++ b/lib/puppet/provider/splunkforwarder_server/ini_setting.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Puppet::Type.type(:splunkforwarder_server).provide(
:ini_setting,
parent: Puppet::Type.type(:ini_setting).provider(:splunk)
diff --git a/lib/puppet/provider/splunkforwarder_transforms/ini_setting.rb b/lib/puppet/provider/splunkforwarder_transforms/ini_setting.rb
index 8b127000..5069ff10 100644
--- a/lib/puppet/provider/splunkforwarder_transforms/ini_setting.rb
+++ b/lib/puppet/provider/splunkforwarder_transforms/ini_setting.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Puppet::Type.type(:splunkforwarder_transforms).provide(
:ini_setting,
parent: Puppet::Type.type(:ini_setting).provider(:splunk)
diff --git a/lib/puppet/provider/splunkforwarder_web/ini_setting.rb b/lib/puppet/provider/splunkforwarder_web/ini_setting.rb
index 88d4ec32..0f235502 100644
--- a/lib/puppet/provider/splunkforwarder_web/ini_setting.rb
+++ b/lib/puppet/provider/splunkforwarder_web/ini_setting.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
Puppet::Type.type(:splunkforwarder_web).provide(
:ini_setting,
parent: Puppet::Type.type(:ini_setting).provider(:splunk)
diff --git a/lib/puppet/type/splunk_alert_actions.rb b/lib/puppet/type/splunk_alert_actions.rb
index 76a017c6..ca526221 100644
--- a/lib/puppet/type/splunk_alert_actions.rb
+++ b/lib/puppet/type/splunk_alert_actions.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type')
Puppet::Type.newtype(:splunk_alert_actions) do
diff --git a/lib/puppet/type/splunk_authentication.rb b/lib/puppet/type/splunk_authentication.rb
index 4b81ac00..e70f8026 100644
--- a/lib/puppet/type/splunk_authentication.rb
+++ b/lib/puppet/type/splunk_authentication.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type')
Puppet::Type.newtype(:splunk_authentication) do
diff --git a/lib/puppet/type/splunk_authorize.rb b/lib/puppet/type/splunk_authorize.rb
index c2c2c2c2..1fa9a5d1 100644
--- a/lib/puppet/type/splunk_authorize.rb
+++ b/lib/puppet/type/splunk_authorize.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type')
Puppet::Type.newtype(:splunk_authorize) do
diff --git a/lib/puppet/type/splunk_config.rb b/lib/puppet/type/splunk_config.rb
index 7ae42011..3691b0a0 100644
--- a/lib/puppet/type/splunk_config.rb
+++ b/lib/puppet/type/splunk_config.rb
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
# Require all of our types so the class names are resolvable for purging
-Dir[File.dirname(__FILE__) + '/splunk*.rb'].each do |file|
+Dir["#{File.dirname(__FILE__)}/splunk*.rb"].sort.each do |file|
require file unless file == __FILE__
end
@@ -8,6 +10,7 @@
desc 'splunk config'
end
+ # rubocop:disable Lint/EmptyBlock
newparam(:forwarder_installdir) do
end
@@ -19,32 +22,33 @@
newparam(:server_confdir) do
end
+ # rubocop:enable Lint/EmptyBlock
## Generate purge parameters for the splunk_config type
- [
- :purge_inputs,
- :purge_outputs,
- :purge_alert_actions,
- :purge_authentication,
- :purge_authorize,
- :purge_deploymentclient,
- :purge_distsearch,
- :purge_indexes,
- :purge_limits,
- :purge_metadata,
- :purge_props,
- :purge_server,
- :purge_serverclass,
- :purge_transforms,
- :purge_web,
- :purge_uiprefs,
- :purge_forwarder_deploymentclient,
- :purge_forwarder_inputs,
- :purge_forwarder_outputs,
- :purge_forwarder_props,
- :purge_forwarder_transforms,
- :purge_forwarder_web,
- :purge_forwarder_server
+ %i[
+ purge_inputs
+ purge_outputs
+ purge_alert_actions
+ purge_authentication
+ purge_authorize
+ purge_deploymentclient
+ purge_distsearch
+ purge_indexes
+ purge_limits
+ purge_metadata
+ purge_props
+ purge_server
+ purge_serverclass
+ purge_transforms
+ purge_web
+ purge_uiprefs
+ purge_forwarder_deploymentclient
+ purge_forwarder_inputs
+ purge_forwarder_outputs
+ purge_forwarder_props
+ purge_forwarder_transforms
+ purge_forwarder_web
+ purge_forwarder_server
].each do |p|
newparam(p) do
newvalues(:true, :false)
@@ -91,36 +95,36 @@ def generate
end
def set_provider_paths
- [
- :splunk_alert_actions,
- :splunk_authentication,
- :splunk_authorize,
- :splunk_deploymentclient,
- :splunk_distsearch,
- :splunk_indexes,
- :splunk_limits,
- :splunk_input,
- :splunk_output,
- :splunk_metadata,
- :splunk_props,
- :splunk_server,
- :splunk_serverclass,
- :splunk_transforms,
- :splunk_web,
- :splunk_uiprefs
+ %i[
+ splunk_alert_actions
+ splunk_authentication
+ splunk_authorize
+ splunk_deploymentclient
+ splunk_distsearch
+ splunk_indexes
+ splunk_limits
+ splunk_input
+ splunk_output
+ splunk_metadata
+ splunk_props
+ splunk_server
+ splunk_serverclass
+ splunk_transforms
+ splunk_web
+ splunk_uiprefs
].each do |res_type|
provider_class = Puppet::Type.type(res_type).provider(:ini_setting)
provider_class.file_path = self[:server_confdir]
end
- [
- :splunkforwarder_deploymentclient,
- :splunkforwarder_input,
- :splunkforwarder_output,
- :splunkforwarder_props,
- :splunkforwarder_transforms,
- :splunkforwarder_web,
- :splunkforwarder_server,
- :splunkforwarder_limits
+ %i[
+ splunkforwarder_deploymentclient
+ splunkforwarder_input
+ splunkforwarder_output
+ splunkforwarder_props
+ splunkforwarder_transforms
+ splunkforwarder_web
+ splunkforwarder_server
+ splunkforwarder_limits
].each do |res_type|
provider_class = Puppet::Type.type(res_type).provider(:ini_setting)
provider_class.file_path = self[:forwarder_confdir]
@@ -156,7 +160,7 @@ def purge_splunk_resources_in_context(type_class, context)
catalog_resources = catalog.resources.select { |r| r.is_a?(type_class) && r[:context] == context }
Puppet.debug "Found #{catalog_resources.size} #{type_class} resources in context #{context}"
catalog_resources.each do |res|
- puppet_resources << res[:section] + '/' + res[:setting]
+ puppet_resources << ("#{res[:section]}/#{res[:setting]}")
end
# Search the configured instances of the class type and purge them if
@@ -178,6 +182,7 @@ def purge_splunk_resources_in_context(type_class, context)
instances.each do |instance|
next if puppet_resources.include?(instance.name)
+
purge_resources << Puppet::Type.type(type_name).new(
name: "Purge #{context} #{instance.name}",
section: instance[:section],
diff --git a/lib/puppet/type/splunk_deploymentclient.rb b/lib/puppet/type/splunk_deploymentclient.rb
index 8bb567ab..294afa05 100644
--- a/lib/puppet/type/splunk_deploymentclient.rb
+++ b/lib/puppet/type/splunk_deploymentclient.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type')
Puppet::Type.newtype(:splunk_deploymentclient) do
diff --git a/lib/puppet/type/splunk_distsearch.rb b/lib/puppet/type/splunk_distsearch.rb
index 27c8c7b2..a65e48d5 100644
--- a/lib/puppet/type/splunk_distsearch.rb
+++ b/lib/puppet/type/splunk_distsearch.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type')
Puppet::Type.newtype(:splunk_distsearch) do
diff --git a/lib/puppet/type/splunk_indexes.rb b/lib/puppet/type/splunk_indexes.rb
index 90607a68..196f6e27 100644
--- a/lib/puppet/type/splunk_indexes.rb
+++ b/lib/puppet/type/splunk_indexes.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type')
Puppet::Type.newtype(:splunk_indexes) do
diff --git a/lib/puppet/type/splunk_input.rb b/lib/puppet/type/splunk_input.rb
index 5c2f1861..57ec0417 100644
--- a/lib/puppet/type/splunk_input.rb
+++ b/lib/puppet/type/splunk_input.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type')
Puppet::Type.newtype(:splunk_input) do
diff --git a/lib/puppet/type/splunk_limits.rb b/lib/puppet/type/splunk_limits.rb
index 29fb7c69..664beacf 100644
--- a/lib/puppet/type/splunk_limits.rb
+++ b/lib/puppet/type/splunk_limits.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type')
Puppet::Type.newtype(:splunk_limits) do
diff --git a/lib/puppet/type/splunk_metadata.rb b/lib/puppet/type/splunk_metadata.rb
index c90c347f..285bf553 100644
--- a/lib/puppet/type/splunk_metadata.rb
+++ b/lib/puppet/type/splunk_metadata.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type')
Puppet::Type.newtype(:splunk_metadata) do
diff --git a/lib/puppet/type/splunk_output.rb b/lib/puppet/type/splunk_output.rb
index ab2b9658..76a58e90 100644
--- a/lib/puppet/type/splunk_output.rb
+++ b/lib/puppet/type/splunk_output.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type')
Puppet::Type.newtype(:splunk_output) do
diff --git a/lib/puppet/type/splunk_props.rb b/lib/puppet/type/splunk_props.rb
index db1ce094..7db6340b 100644
--- a/lib/puppet/type/splunk_props.rb
+++ b/lib/puppet/type/splunk_props.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type')
Puppet::Type.newtype(:splunk_props) do
diff --git a/lib/puppet/type/splunk_server.rb b/lib/puppet/type/splunk_server.rb
index ece5b5c1..1367ff9d 100644
--- a/lib/puppet/type/splunk_server.rb
+++ b/lib/puppet/type/splunk_server.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type')
Puppet::Type.newtype(:splunk_server) do
diff --git a/lib/puppet/type/splunk_serverclass.rb b/lib/puppet/type/splunk_serverclass.rb
index 0b58cd58..b91dbd0d 100644
--- a/lib/puppet/type/splunk_serverclass.rb
+++ b/lib/puppet/type/splunk_serverclass.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type')
Puppet::Type.newtype(:splunk_serverclass) do
diff --git a/lib/puppet/type/splunk_transforms.rb b/lib/puppet/type/splunk_transforms.rb
index 6a1f01a8..62fdeb67 100644
--- a/lib/puppet/type/splunk_transforms.rb
+++ b/lib/puppet/type/splunk_transforms.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type')
Puppet::Type.newtype(:splunk_transforms) do
diff --git a/lib/puppet/type/splunk_uiprefs.rb b/lib/puppet/type/splunk_uiprefs.rb
index c8aa5e54..453abc5c 100644
--- a/lib/puppet/type/splunk_uiprefs.rb
+++ b/lib/puppet/type/splunk_uiprefs.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type')
Puppet::Type.newtype(:splunk_uiprefs) do
diff --git a/lib/puppet/type/splunk_web.rb b/lib/puppet/type/splunk_web.rb
index 9d28a830..b4bdb365 100644
--- a/lib/puppet/type/splunk_web.rb
+++ b/lib/puppet/type/splunk_web.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type')
Puppet::Type.newtype(:splunk_web) do
diff --git a/lib/puppet/type/splunkforwarder_deploymentclient.rb b/lib/puppet/type/splunkforwarder_deploymentclient.rb
index 0893074d..f3e312cf 100644
--- a/lib/puppet/type/splunkforwarder_deploymentclient.rb
+++ b/lib/puppet/type/splunkforwarder_deploymentclient.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type')
Puppet::Type.newtype(:splunkforwarder_deploymentclient) do
diff --git a/lib/puppet/type/splunkforwarder_input.rb b/lib/puppet/type/splunkforwarder_input.rb
index 2a6a1871..1bc4e243 100644
--- a/lib/puppet/type/splunkforwarder_input.rb
+++ b/lib/puppet/type/splunkforwarder_input.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type')
Puppet::Type.newtype(:splunkforwarder_input) do
diff --git a/lib/puppet/type/splunkforwarder_limits.rb b/lib/puppet/type/splunkforwarder_limits.rb
index 95371bf3..8721e4ea 100644
--- a/lib/puppet/type/splunkforwarder_limits.rb
+++ b/lib/puppet/type/splunkforwarder_limits.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type')
Puppet::Type.newtype(:splunkforwarder_limits) do
diff --git a/lib/puppet/type/splunkforwarder_output.rb b/lib/puppet/type/splunkforwarder_output.rb
index 66e31f70..2d65c2d9 100644
--- a/lib/puppet/type/splunkforwarder_output.rb
+++ b/lib/puppet/type/splunkforwarder_output.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type')
Puppet::Type.newtype(:splunkforwarder_output) do
diff --git a/lib/puppet/type/splunkforwarder_props.rb b/lib/puppet/type/splunkforwarder_props.rb
index 60af3d23..b873ee5e 100644
--- a/lib/puppet/type/splunkforwarder_props.rb
+++ b/lib/puppet/type/splunkforwarder_props.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type')
Puppet::Type.newtype(:splunkforwarder_props) do
diff --git a/lib/puppet/type/splunkforwarder_server.rb b/lib/puppet/type/splunkforwarder_server.rb
index c643d608..d6b3ba78 100644
--- a/lib/puppet/type/splunkforwarder_server.rb
+++ b/lib/puppet/type/splunkforwarder_server.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type')
Puppet::Type.newtype(:splunkforwarder_server) do
diff --git a/lib/puppet/type/splunkforwarder_transforms.rb b/lib/puppet/type/splunkforwarder_transforms.rb
index 9cd72aa7..8e49a1c4 100644
--- a/lib/puppet/type/splunkforwarder_transforms.rb
+++ b/lib/puppet/type/splunkforwarder_transforms.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type')
Puppet::Type.newtype(:splunkforwarder_transforms) do
diff --git a/lib/puppet/type/splunkforwarder_web.rb b/lib/puppet/type/splunkforwarder_web.rb
index e1632b11..97966459 100644
--- a/lib/puppet/type/splunkforwarder_web.rb
+++ b/lib/puppet/type/splunkforwarder_web.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require File.join(File.dirname(__FILE__), '..', '..', 'puppet_x/puppetlabs/splunk/type')
Puppet::Type.newtype(:splunkforwarder_web) do
diff --git a/lib/puppet_x/puppetlabs/splunk/type.rb b/lib/puppet_x/puppetlabs/splunk/type.rb
index c576200d..c1f3641c 100644
--- a/lib/puppet_x/puppetlabs/splunk/type.rb
+++ b/lib/puppet_x/puppetlabs/splunk/type.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require File.join(File.dirname(__FILE__), '..', '..', 'voxpupuli/splunk/util')
module PuppetX
@@ -9,14 +11,14 @@ def self.clone_type(type)
type.define_singleton_method(:title_patterns) do
[
- [%r{^([^\/]*)$}, [[:section]]], # matches section titles without slashes, like 'tcpout:indexers'
- [%r{^(.*\/\/.*)\/(.*)$}, # matches section titles containing '//' and a setting,
- [ # like: 'monitor:///var/log/messages/index'
+ [%r{^([^/]*)$}, [[:section]]], # matches section titles without slashes, like 'tcpout:indexers'
+ [%r{^(.*//.*)/(.*)$}, # matches section titles containing '//' and a setting,
+ [ # like: 'monitor:///var/log/messages/index'
[:section], # where 'monitor:///var/log/messages' is the section
[:setting] # and 'index' is the setting.
]],
- [%r{^(.*\/\/.*)$}, [[:section]]], # matches section titles containing '//', like 'tcp://127.0.0.1:19500'
- [%r{^(.*)\/(.*)$}, # matches plain 'section/setting' titles, like: 'tcpout:indexers/server'
+ [%r{^(.*//.*)$}, [[:section]]], # matches section titles containing '//', like 'tcp://127.0.0.1:19500'
+ [%r{^(.*)/(.*)$}, # matches plain 'section/setting' titles, like: 'tcpout:indexers/server'
[
[:section],
[:setting]
diff --git a/lib/puppet_x/voxpupuli/splunk/util.rb b/lib/puppet_x/voxpupuli/splunk/util.rb
index 1148cfd3..1c81c567 100644
--- a/lib/puppet_x/voxpupuli/splunk/util.rb
+++ b/lib/puppet_x/voxpupuli/splunk/util.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'openssl'
require 'base64'
@@ -9,16 +11,15 @@ def self.decrypt(secrets_file, value)
return value unless value.start_with?('$7$')
Puppet.debug "Decrypting splunk >= 7.2 data using secret from #{secrets_file}"
- value.slice!(0, 3)
- data = Base64.strict_decode64(value)
- splunk_secret = IO.binread(secrets_file).chomp
+ data = Base64.strict_decode64(value[3..-1])
+ splunk_secret = File.binread(secrets_file).chomp
iv = data.bytes[0, 16].pack('c*')
tag = data.bytes[-16..-1].pack('c*')
ciphertext = data.bytes[16..-17].pack('c*')
- decipher = OpenSSL::Cipher::AES.new(256, :GCM).decrypt
- decipher.key = OpenSSL::PKCS5.pbkdf2_hmac(splunk_secret, 'disk-encryption', 1, 32, OpenSSL::Digest::SHA256.new)
+ decipher = OpenSSL::Cipher.new('aes-256-gcm').decrypt
+ decipher.key = OpenSSL::PKCS5.pbkdf2_hmac(splunk_secret, 'disk-encryption', 1, 32, OpenSSL::Digest.new('SHA256'))
decipher.iv_len = 16
decipher.iv = iv
decipher.auth_tag = tag
diff --git a/spec/acceptance/splunk_enterprise_spec.rb b/spec/acceptance/splunk_enterprise_spec.rb
index 22863751..c59baa01 100644
--- a/spec/acceptance/splunk_enterprise_spec.rb
+++ b/spec/acceptance/splunk_enterprise_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper_acceptance'
describe 'splunk enterprise class' do
@@ -13,11 +15,20 @@
it 'works idempotently with no errors' do
pp = <<-EOS
class { 'splunk::enterprise': }
+
+ # See https://community.splunk.com/t5/Installation/Why-am-I-getting-an-error-to-start-a-fresh-Splunk-instance-in-my/m-p/336938
+ file_line { 'file_locking':
+ path => '/opt/splunk/etc/splunk-launch.conf',
+ line => 'OPTIMISTIC_ABOUT_FILE_LOCKING=1',
+ require => Class['splunk::enterprise'],
+ }
EOS
# Run it twice and test for idempotency
apply_manifest(pp, catch_failures: true)
apply_manifest(pp, catch_changes: true)
+ # give splunk some time to start
+ sleep(10)
end
describe package('splunk') do
@@ -52,6 +63,8 @@ class { 'splunk::enterprise':
EOS
apply_manifest(pp, catch_failures: true)
+ # give splunk some time to start
+ sleep(10)
end
it 'works idempotently with no errors' do
@@ -84,6 +97,7 @@ class { 'splunk::enterprise':
EOS
apply_manifest(pp, catch_failures: true)
end
+
describe package('splunk') do
it { is_expected.not_to be_installed }
end
diff --git a/spec/acceptance/splunk_forwarder_spec.rb b/spec/acceptance/splunk_forwarder_spec.rb
index 953ecd68..feff4e47 100644
--- a/spec/acceptance/splunk_forwarder_spec.rb
+++ b/spec/acceptance/splunk_forwarder_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper_acceptance'
describe 'splunk::forwarder class' do
@@ -42,17 +44,18 @@ class { 'splunk::forwarder':
it { is_expected.to be_running }
end
end
+
context 'purging' do
context 'purge_outputs => false' do
it 'works idempotently with no errors' do
- pp = <<-eos
+ pp = <<-EOS
class { 'splunk::params':
}
class { 'splunk::forwarder':
splunkd_port => 8090,
purge_outputs => false,
}
- eos
+ EOS
# run it twice and test for idempotency
apply_manifest(pp, catch_failures: true)
@@ -64,16 +67,17 @@ class { 'splunk::forwarder':
its(:content) { is_expected.to match %r{^sslPassword} }
end
end
+
context 'purge_outputs => true' do
it 'works idempotently with no errors' do
- pp = <<-eos
+ pp = <<-EOS
class { 'splunk::params':
}
class { 'splunk::forwarder':
splunkd_port => 8090,
purge_outputs => true,
}
- eos
+ EOS
# run it twice and test for idempotency
apply_manifest(pp, catch_failures: true)
diff --git a/spec/classes/enterprise_spec.rb b/spec/classes/enterprise_spec.rb
index bae00f19..7bd12ef2 100644
--- a/spec/classes/enterprise_spec.rb
+++ b/spec/classes/enterprise_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
shared_examples_for 'splunk enterprise nix defaults' do
@@ -39,366 +41,364 @@
describe 'splunk::enterprise' do
context 'supported operating systems' do
on_supported_os.each do |os, facts|
- if os.start_with?('windows')
- # Splunk Server not used supported on windows
- else
- context "on #{os}" do
- let(:facts) do
- facts
+ next if facts[:os]['name'] == 'windows' # Splunk Server not used supported on windows
+
+ context "on #{os}" do
+ let(:facts) do
+ facts
+ end
+
+ context 'splunk when including forwarder and enterprise' do
+ let(:pre_condition) do
+ 'include splunk::forwarder'
end
- context 'splunk when including forwarder and enterprise' do
- let(:pre_condition) do
- 'include splunk::forwarder'
- end
+ it { is_expected.to compile.and_raise_error(%r{Do not include splunk::forwarder on the same node as splunk::enterprise}) }
+ end
- it { is_expected.to compile.and_raise_error(%r{Do not include splunk::forwarder on the same node as splunk::enterprise}) }
+ context 'when manage_password = true' do
+ if facts[:kernel] == 'Linux' || facts[:kernel] == 'SunOS'
+ let(:params) { { 'manage_password' => true } }
+
+ it { is_expected.to compile.with_all_deps }
+ it { is_expected.to contain_file('/opt/splunk/etc/splunk.secret') }
+ it { is_expected.to contain_file('/opt/splunk/etc/passwd') }
end
+ end
- context 'when manage_password = true' do
- if facts[:kernel] == 'Linux' || facts[:kernel] == 'SunOS'
- let(:params) { { 'manage_password' => true } }
+ context 'when package_provider = yum' do
+ if facts[:kernel] == 'Linux' || facts[:kernel] == 'SunOS'
+ let(:params) { { 'package_provider' => 'yum' } }
- it { is_expected.to compile.with_all_deps }
- it { is_expected.to contain_file('/opt/splunk/etc/splunk.secret') }
- it { is_expected.to contain_file('/opt/splunk/etc/passwd') }
- end
+ it { is_expected.to contain_package('splunk').with(provider: 'yum') }
end
+ end
- context 'when package_provider = yum' do
- if facts[:kernel] == 'Linux' || facts[:kernel] == 'SunOS'
- let(:params) { { 'package_provider' => 'yum' } }
+ context 'with $boot_start = true (defaults)' do
+ if facts[:kernel] == 'Linux' || facts[:kernel] == 'SunOS'
- it { is_expected.to contain_package('splunk').with(provider: 'yum') }
+ context 'with $facts[service_provider] == init and $splunk::params::version >= 7.2.2' do
+ let(:facts) do
+ facts.merge(service_provider: 'init')
+ end
+ let(:pre_condition) do
+ "class { 'splunk::params': version => '7.2.4.2' }"
+ end
+
+ it_behaves_like 'splunk enterprise nix defaults'
+ it { is_expected.to contain_package('net-tools').with(ensure: 'installed') }
+ it { is_expected.to contain_class('splunk::enterprise').with(service_name: 'splunk') }
+ it { is_expected.not_to contain_file('/etc/init.d/splunk').with(ensure: 'absent') }
+ it { is_expected.to contain_exec('stop_splunk').with(command: '/opt/splunk/bin/splunk stop') }
+ it { is_expected.to contain_exec('enable_splunk').with(command: '/opt/splunk/bin/splunk enable boot-start -user root --accept-license --answer-yes --no-prompt') }
+ it { is_expected.not_to contain_exec('disable_splunk') }
+ it { is_expected.not_to contain_exec('license_splunk') }
+ it { is_expected.to contain_service('splunk').with(ensure: 'running', enable: true, status: nil, restart: nil, start: nil, stop: nil) }
+ end
+
+ context 'with $facts[service_provider] == init and $splunk::params::version >= 7.2.2 and manage_net_tools == false' do
+ let(:facts) do
+ facts.merge(service_provider: 'init')
+ end
+ let(:pre_condition) do
+ "class { 'splunk::params': version => '7.2.4.2', manage_net_tools => false }"
+ end
+
+ it_behaves_like 'splunk enterprise nix defaults'
+ it { is_expected.not_to contain_package('net-tools') }
+ it { is_expected.to contain_class('splunk::enterprise').with(service_name: 'splunk') }
+ it { is_expected.not_to contain_file('/etc/init.d/splunk').with(ensure: 'absent') }
+ it { is_expected.to contain_exec('stop_splunk').with(command: '/opt/splunk/bin/splunk stop') }
+ it { is_expected.to contain_exec('enable_splunk').with(command: '/opt/splunk/bin/splunk enable boot-start -user root --accept-license --answer-yes --no-prompt') }
+ it { is_expected.not_to contain_exec('disable_splunk') }
+ it { is_expected.not_to contain_exec('license_splunk') }
+ it { is_expected.to contain_service('splunk').with(ensure: 'running', enable: true, status: nil, restart: nil, start: nil, stop: nil) }
+ end
+
+ context 'with $facts[service_provider] == init and $splunk::params::version < 7.2.2' do
+ let(:facts) do
+ facts.merge(service_provider: 'init')
+ end
+ let(:pre_condition) do
+ "class { 'splunk::params': version => '6.0.0' }"
+ end
+
+ it_behaves_like 'splunk enterprise nix defaults'
+ it { is_expected.not_to contain_package('net-tools').with(ensure: 'installed') }
+ it { is_expected.to contain_class('splunk::enterprise').with(service_name: 'splunk') }
+ it { is_expected.not_to contain_file('/etc/init.d/splunk').with(ensure: 'absent') }
+ it { is_expected.to contain_exec('stop_splunk').with(command: '/opt/splunk/bin/splunk stop') }
+ it { is_expected.to contain_exec('enable_splunk').with(command: '/opt/splunk/bin/splunk enable boot-start -user root --accept-license --answer-yes --no-prompt') }
+ it { is_expected.not_to contain_exec('disable_splunk') }
+ it { is_expected.not_to contain_exec('license_splunk') }
+ it { is_expected.to contain_service('splunk').with(ensure: 'running', enable: true, status: nil, restart: nil, start: nil, stop: nil) }
+ end
+
+ context 'with $facts[service_provider] == init and $splunk::params::version < 7.2.2 and manage_net_tools == false' do
+ let(:facts) do
+ facts.merge(service_provider: 'init')
+ end
+ let(:pre_condition) do
+ "class { 'splunk::params': version => '6.0.0', manage_net_tools => false }"
+ end
+
+ it_behaves_like 'splunk enterprise nix defaults'
+ it { is_expected.not_to contain_package('net-tools') }
+ it { is_expected.to contain_class('splunk::enterprise').with(service_name: 'splunk') }
+ it { is_expected.not_to contain_file('/etc/init.d/splunk').with(ensure: 'absent') }
+ it { is_expected.to contain_exec('stop_splunk').with(command: '/opt/splunk/bin/splunk stop') }
+ it { is_expected.to contain_exec('enable_splunk').with(command: '/opt/splunk/bin/splunk enable boot-start -user root --accept-license --answer-yes --no-prompt') }
+ it { is_expected.not_to contain_exec('disable_splunk') }
+ it { is_expected.not_to contain_exec('license_splunk') }
+ it { is_expected.to contain_service('splunk').with(ensure: 'running', enable: true, status: nil, restart: nil, start: nil, stop: nil) }
+ end
+
+ context 'with $facts[service_provider] == systemd and $splunk::params::version >= 7.2.2' do
+ let(:facts) do
+ facts.merge(service_provider: 'systemd')
+ end
+ let(:pre_condition) do
+ "class { 'splunk::params': version => '7.2.4.2' }"
+ end
+
+ it_behaves_like 'splunk enterprise nix defaults'
+ it { is_expected.to contain_package('net-tools').with(ensure: 'installed') }
+ it { is_expected.to contain_class('splunk::enterprise').with(service_name: 'Splunkd') }
+ it { is_expected.to contain_file('/etc/init.d/splunk').with(ensure: 'absent') }
+ it { is_expected.to contain_exec('stop_splunk').with(command: '/opt/splunk/bin/splunk stop') }
+ it { is_expected.to contain_exec('enable_splunk').with(command: '/opt/splunk/bin/splunk enable boot-start -systemd-managed 1 --accept-license --answer-yes --no-prompt') }
+ it { is_expected.not_to contain_exec('disable_splunk') }
+ it { is_expected.not_to contain_exec('license_splunk') }
+ it { is_expected.to contain_service('Splunkd').with(ensure: 'running', enable: true, status: nil, restart: nil, start: nil, stop: nil) }
+ end
+
+ context 'with $facts[service_provider] == systemd and $splunk::params::version >= 7.2.2 and manage_net_tools == false' do
+ let(:facts) do
+ facts.merge(service_provider: 'systemd')
+ end
+ let(:pre_condition) do
+ "class { 'splunk::params': version => '7.2.4.2', manage_net_tools => false }"
+ end
+
+ it_behaves_like 'splunk enterprise nix defaults'
+ it { is_expected.not_to contain_package('net-tools') }
+ it { is_expected.to contain_class('splunk::enterprise').with(service_name: 'Splunkd') }
+ it { is_expected.to contain_file('/etc/init.d/splunk').with(ensure: 'absent') }
+ it { is_expected.to contain_exec('stop_splunk').with(command: '/opt/splunk/bin/splunk stop') }
+ it { is_expected.to contain_exec('enable_splunk').with(command: '/opt/splunk/bin/splunk enable boot-start -systemd-managed 1 --accept-license --answer-yes --no-prompt') }
+ it { is_expected.not_to contain_exec('disable_splunk') }
+ it { is_expected.not_to contain_exec('license_splunk') }
+ it { is_expected.to contain_service('Splunkd').with(ensure: 'running', enable: true, status: nil, restart: nil, start: nil, stop: nil) }
+ end
+
+ context 'with $facts[service_provider] == systemd and $splunk::params::version >= 7.2.2 and user != root' do
+ let(:facts) do
+ facts.merge(service_provider: 'systemd')
+ end
+ let(:pre_condition) do
+ "class { 'splunk::params': version => '7.2.4.2' }"
+ end
+ let(:params) { { splunk_user: 'splunk' } }
+
+ it { is_expected.to contain_exec('enable_splunk').with(command: '/opt/splunk/bin/splunk enable boot-start -user splunk -systemd-managed 1 --accept-license --answer-yes --no-prompt') }
+ end
+
+ context 'with $facts[service_provider] == systemd and $splunk::params::version < 7.2.2' do
+ let(:facts) do
+ facts.merge(service_provider: 'systemd')
+ end
+ let(:pre_condition) do
+ "class { 'splunk::params': version => '6.0.0' }"
+ end
+
+ it_behaves_like 'splunk enterprise nix defaults'
+ it { is_expected.not_to contain_package('net-tools').with(ensure: 'installed') }
+ it { is_expected.to contain_class('splunk::enterprise').with(service_name: 'splunk') }
+ it { is_expected.not_to contain_file('/etc/init.d/splunk').with(ensure: 'absent') }
+ it { is_expected.to contain_exec('stop_splunk').with(command: '/opt/splunk/bin/splunk stop') }
+ it { is_expected.to contain_exec('enable_splunk').with(command: '/opt/splunk/bin/splunk enable boot-start -user root --accept-license --answer-yes --no-prompt') }
+ it { is_expected.not_to contain_exec('disable_splunk') }
+ it { is_expected.not_to contain_exec('license_splunk') }
+ it { is_expected.to contain_service('splunk').with(ensure: 'running', enable: true, status: nil, restart: nil, start: nil, stop: nil) }
end
- end
- context 'with $boot_start = true (defaults)' do
- if facts[:kernel] == 'Linux' || facts[:kernel] == 'SunOS'
-
- context 'with $facts[service_provider] == init and $splunk::params::version >= 7.2.2' do
- let(:facts) do
- facts.merge(service_provider: 'init')
- end
- let(:pre_condition) do
- "class { 'splunk::params': version => '7.2.4.2' }"
- end
-
- it_behaves_like 'splunk enterprise nix defaults'
- it { is_expected.to contain_package('net-tools').with(ensure: 'installed') }
- it { is_expected.to contain_class('splunk::enterprise').with(service_name: 'splunk') }
- it { is_expected.not_to contain_file('/etc/init.d/splunk').with(ensure: 'absent') }
- it { is_expected.to contain_exec('stop_splunk').with(command: '/opt/splunk/bin/splunk stop') }
- it { is_expected.to contain_exec('enable_splunk').with(command: '/opt/splunk/bin/splunk enable boot-start -user root --accept-license --answer-yes --no-prompt') }
- it { is_expected.not_to contain_exec('disable_splunk') }
- it { is_expected.not_to contain_exec('license_splunk') }
- it { is_expected.to contain_service('splunk').with(ensure: 'running', enable: true, status: nil, restart: nil, start: nil, stop: nil) }
- end
-
- context 'with $facts[service_provider] == init and $splunk::params::version >= 7.2.2 and manage_net_tools == false' do
- let(:facts) do
- facts.merge(service_provider: 'init')
- end
- let(:pre_condition) do
- "class { 'splunk::params': version => '7.2.4.2', manage_net_tools => false }"
- end
-
- it_behaves_like 'splunk enterprise nix defaults'
- it { is_expected.not_to contain_package('net-tools') }
- it { is_expected.to contain_class('splunk::enterprise').with(service_name: 'splunk') }
- it { is_expected.not_to contain_file('/etc/init.d/splunk').with(ensure: 'absent') }
- it { is_expected.to contain_exec('stop_splunk').with(command: '/opt/splunk/bin/splunk stop') }
- it { is_expected.to contain_exec('enable_splunk').with(command: '/opt/splunk/bin/splunk enable boot-start -user root --accept-license --answer-yes --no-prompt') }
- it { is_expected.not_to contain_exec('disable_splunk') }
- it { is_expected.not_to contain_exec('license_splunk') }
- it { is_expected.to contain_service('splunk').with(ensure: 'running', enable: true, status: nil, restart: nil, start: nil, stop: nil) }
- end
-
- context 'with $facts[service_provider] == init and $splunk::params::version < 7.2.2' do
- let(:facts) do
- facts.merge(service_provider: 'init')
- end
- let(:pre_condition) do
- "class { 'splunk::params': version => '6.0.0' }"
- end
-
- it_behaves_like 'splunk enterprise nix defaults'
- it { is_expected.not_to contain_package('net-tools').with(ensure: 'installed') }
- it { is_expected.to contain_class('splunk::enterprise').with(service_name: 'splunk') }
- it { is_expected.not_to contain_file('/etc/init.d/splunk').with(ensure: 'absent') }
- it { is_expected.to contain_exec('stop_splunk').with(command: '/opt/splunk/bin/splunk stop') }
- it { is_expected.to contain_exec('enable_splunk').with(command: '/opt/splunk/bin/splunk enable boot-start -user root --accept-license --answer-yes --no-prompt') }
- it { is_expected.not_to contain_exec('disable_splunk') }
- it { is_expected.not_to contain_exec('license_splunk') }
- it { is_expected.to contain_service('splunk').with(ensure: 'running', enable: true, status: nil, restart: nil, start: nil, stop: nil) }
- end
-
- context 'with $facts[service_provider] == init and $splunk::params::version < 7.2.2 and manage_net_tools == false' do
- let(:facts) do
- facts.merge(service_provider: 'init')
- end
- let(:pre_condition) do
- "class { 'splunk::params': version => '6.0.0', manage_net_tools => false }"
- end
-
- it_behaves_like 'splunk enterprise nix defaults'
- it { is_expected.not_to contain_package('net-tools') }
- it { is_expected.to contain_class('splunk::enterprise').with(service_name: 'splunk') }
- it { is_expected.not_to contain_file('/etc/init.d/splunk').with(ensure: 'absent') }
- it { is_expected.to contain_exec('stop_splunk').with(command: '/opt/splunk/bin/splunk stop') }
- it { is_expected.to contain_exec('enable_splunk').with(command: '/opt/splunk/bin/splunk enable boot-start -user root --accept-license --answer-yes --no-prompt') }
- it { is_expected.not_to contain_exec('disable_splunk') }
- it { is_expected.not_to contain_exec('license_splunk') }
- it { is_expected.to contain_service('splunk').with(ensure: 'running', enable: true, status: nil, restart: nil, start: nil, stop: nil) }
- end
-
- context 'with $facts[service_provider] == systemd and $splunk::params::version >= 7.2.2' do
- let(:facts) do
- facts.merge(service_provider: 'systemd')
- end
- let(:pre_condition) do
- "class { 'splunk::params': version => '7.2.4.2' }"
- end
-
- it_behaves_like 'splunk enterprise nix defaults'
- it { is_expected.to contain_package('net-tools').with(ensure: 'installed') }
- it { is_expected.to contain_class('splunk::enterprise').with(service_name: 'Splunkd') }
- it { is_expected.to contain_file('/etc/init.d/splunk').with(ensure: 'absent') }
- it { is_expected.to contain_exec('stop_splunk').with(command: '/opt/splunk/bin/splunk stop') }
- it { is_expected.to contain_exec('enable_splunk').with(command: '/opt/splunk/bin/splunk enable boot-start -systemd-managed 1 --accept-license --answer-yes --no-prompt') }
- it { is_expected.not_to contain_exec('disable_splunk') }
- it { is_expected.not_to contain_exec('license_splunk') }
- it { is_expected.to contain_service('Splunkd').with(ensure: 'running', enable: true, status: nil, restart: nil, start: nil, stop: nil) }
- end
-
- context 'with $facts[service_provider] == systemd and $splunk::params::version >= 7.2.2 and manage_net_tools == false' do
- let(:facts) do
- facts.merge(service_provider: 'systemd')
- end
- let(:pre_condition) do
- "class { 'splunk::params': version => '7.2.4.2', manage_net_tools => false }"
- end
-
- it_behaves_like 'splunk enterprise nix defaults'
- it { is_expected.not_to contain_package('net-tools') }
- it { is_expected.to contain_class('splunk::enterprise').with(service_name: 'Splunkd') }
- it { is_expected.to contain_file('/etc/init.d/splunk').with(ensure: 'absent') }
- it { is_expected.to contain_exec('stop_splunk').with(command: '/opt/splunk/bin/splunk stop') }
- it { is_expected.to contain_exec('enable_splunk').with(command: '/opt/splunk/bin/splunk enable boot-start -systemd-managed 1 --accept-license --answer-yes --no-prompt') }
- it { is_expected.not_to contain_exec('disable_splunk') }
- it { is_expected.not_to contain_exec('license_splunk') }
- it { is_expected.to contain_service('Splunkd').with(ensure: 'running', enable: true, status: nil, restart: nil, start: nil, stop: nil) }
- end
-
- context 'with $facts[service_provider] == systemd and $splunk::params::version >= 7.2.2 and user != root' do
- let(:facts) do
- facts.merge(service_provider: 'systemd')
- end
- let(:pre_condition) do
- "class { 'splunk::params': version => '7.2.4.2' }"
- end
- let(:params) { { splunk_user: 'splunk' } }
-
- it { is_expected.to contain_exec('enable_splunk').with(command: '/opt/splunk/bin/splunk enable boot-start -user splunk -systemd-managed 1 --accept-license --answer-yes --no-prompt') }
- end
-
- context 'with $facts[service_provider] == systemd and $splunk::params::version < 7.2.2' do
- let(:facts) do
- facts.merge(service_provider: 'systemd')
- end
- let(:pre_condition) do
- "class { 'splunk::params': version => '6.0.0' }"
- end
-
- it_behaves_like 'splunk enterprise nix defaults'
- it { is_expected.not_to contain_package('net-tools').with(ensure: 'installed') }
- it { is_expected.to contain_class('splunk::enterprise').with(service_name: 'splunk') }
- it { is_expected.not_to contain_file('/etc/init.d/splunk').with(ensure: 'absent') }
- it { is_expected.to contain_exec('stop_splunk').with(command: '/opt/splunk/bin/splunk stop') }
- it { is_expected.to contain_exec('enable_splunk').with(command: '/opt/splunk/bin/splunk enable boot-start -user root --accept-license --answer-yes --no-prompt') }
- it { is_expected.not_to contain_exec('disable_splunk') }
- it { is_expected.not_to contain_exec('license_splunk') }
- it { is_expected.to contain_service('splunk').with(ensure: 'running', enable: true, status: nil, restart: nil, start: nil, stop: nil) }
- end
-
- context 'with $facts[service_provider] == systemd and $splunk::params::version < 7.2.2 and manage_net_tools == false' do
- let(:facts) do
- facts.merge(service_provider: 'systemd')
- end
- let(:pre_condition) do
- "class { 'splunk::params': version => '6.0.0', manage_net_tools => false }"
- end
-
- it_behaves_like 'splunk enterprise nix defaults'
- it { is_expected.not_to contain_package('net-tools') }
- it { is_expected.to contain_class('splunk::enterprise').with(service_name: 'splunk') }
- it { is_expected.not_to contain_file('/etc/init.d/splunk').with(ensure: 'absent') }
- it { is_expected.to contain_exec('stop_splunk').with(command: '/opt/splunk/bin/splunk stop') }
- it { is_expected.to contain_exec('enable_splunk').with(command: '/opt/splunk/bin/splunk enable boot-start -user root --accept-license --answer-yes --no-prompt') }
- it { is_expected.not_to contain_exec('disable_splunk') }
- it { is_expected.not_to contain_exec('license_splunk') }
- it { is_expected.to contain_service('splunk').with(ensure: 'running', enable: true, status: nil, restart: nil, start: nil, stop: nil) }
+ context 'with $facts[service_provider] == systemd and $splunk::params::version < 7.2.2 and manage_net_tools == false' do
+ let(:facts) do
+ facts.merge(service_provider: 'systemd')
+ end
+ let(:pre_condition) do
+ "class { 'splunk::params': version => '6.0.0', manage_net_tools => false }"
end
+ it_behaves_like 'splunk enterprise nix defaults'
+ it { is_expected.not_to contain_package('net-tools') }
+ it { is_expected.to contain_class('splunk::enterprise').with(service_name: 'splunk') }
+ it { is_expected.not_to contain_file('/etc/init.d/splunk').with(ensure: 'absent') }
+ it { is_expected.to contain_exec('stop_splunk').with(command: '/opt/splunk/bin/splunk stop') }
+ it { is_expected.to contain_exec('enable_splunk').with(command: '/opt/splunk/bin/splunk enable boot-start -user root --accept-license --answer-yes --no-prompt') }
+ it { is_expected.not_to contain_exec('disable_splunk') }
+ it { is_expected.not_to contain_exec('license_splunk') }
+ it { is_expected.to contain_service('splunk').with(ensure: 'running', enable: true, status: nil, restart: nil, start: nil, stop: nil) }
end
+
end
+ end
+
+ context 'with $boot_start = false' do
+ if facts[:kernel] == 'Linux' || facts[:kernel] == 'SunOS'
- context 'with $boot_start = false' do
- if facts[:kernel] == 'Linux' || facts[:kernel] == 'SunOS'
-
- context 'with $facts[service_provider] == init and $splunk::params::version >= 7.2.2' do
- let(:facts) do
- facts.merge(service_provider: 'init')
- end
- let(:pre_condition) do
- "class { 'splunk::params': version => '7.2.4.2', boot_start => false }"
- end
-
- it_behaves_like 'splunk enterprise nix defaults'
- it { is_expected.to contain_package('net-tools').with(ensure: 'installed') }
- it { is_expected.to contain_class('splunk::enterprise').with(service_name: 'splunk') }
- it { is_expected.not_to contain_file('/etc/init.d/splunk').with(ensure: 'absent') }
- it { is_expected.not_to contain_exec('stop_splunk') }
- it { is_expected.not_to contain_exec('enable_splunk') }
- it { is_expected.to contain_exec('disable_splunk').with(command: '/opt/splunk/bin/splunk disable boot-start -user root --accept-license --answer-yes --no-prompt') }
- it { is_expected.to contain_exec('license_splunk').with(command: '/opt/splunk/bin/splunk start --accept-license --answer-yes --no-prompt') }
- it { is_expected.to contain_service('splunk').with(restart: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk restart'", start: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk start'", stop: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk stop'", status: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk status'") }
- end
-
- context 'with $facts[service_provider] == init and $splunk::params::version >= 7.2.2 and manage_net_tools == false' do
- let(:facts) do
- facts.merge(service_provider: 'init')
- end
- let(:pre_condition) do
- "class { 'splunk::params': version => '7.2.4.2', boot_start => false, manage_net_tools => false }"
- end
-
- it_behaves_like 'splunk enterprise nix defaults'
- it { is_expected.not_to contain_package('net-tools') }
- it { is_expected.to contain_class('splunk::enterprise').with(service_name: 'splunk') }
- it { is_expected.not_to contain_file('/etc/init.d/splunk').with(ensure: 'absent') }
- it { is_expected.not_to contain_exec('stop_splunk') }
- it { is_expected.not_to contain_exec('enable_splunk') }
- it { is_expected.to contain_exec('disable_splunk').with(command: '/opt/splunk/bin/splunk disable boot-start -user root --accept-license --answer-yes --no-prompt') }
- it { is_expected.to contain_exec('license_splunk').with(command: '/opt/splunk/bin/splunk start --accept-license --answer-yes --no-prompt') }
- it { is_expected.to contain_service('splunk').with(restart: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk restart'", start: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk start'", stop: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk stop'", status: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk status'") }
- end
-
- context 'with $facts[service_provider] == init and $splunk::params::version < 7.2.2' do
- let(:facts) do
- facts.merge(service_provider: 'init')
- end
- let(:pre_condition) do
- "class { 'splunk::params': version => '6.0.0', boot_start => false }"
- end
-
- it_behaves_like 'splunk enterprise nix defaults'
- it { is_expected.not_to contain_package('net-tools').with(ensure: 'installed') }
- it { is_expected.to contain_class('splunk::enterprise').with(service_name: 'splunk') }
- it { is_expected.not_to contain_file('/etc/init.d/splunk').with(ensure: 'absent') }
- it { is_expected.not_to contain_exec('stop_splunk') }
- it { is_expected.not_to contain_exec('enable_splunk') }
- it { is_expected.to contain_exec('disable_splunk').with(command: '/opt/splunk/bin/splunk disable boot-start -user root --accept-license --answer-yes --no-prompt') }
- it { is_expected.to contain_exec('license_splunk').with(command: '/opt/splunk/bin/splunk start --accept-license --answer-yes --no-prompt') }
- it { is_expected.to contain_service('splunk').with(restart: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk restart'", start: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk start'", stop: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk stop'", status: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk status'") }
- end
-
- context 'with $facts[service_provider] == init and $splunk::params::version < 7.2.2 and manage_net_tools == false' do
- let(:facts) do
- facts.merge(service_provider: 'init')
- end
- let(:pre_condition) do
- "class { 'splunk::params': version => '6.0.0', boot_start => false, manage_net_tools => false }"
- end
-
- it_behaves_like 'splunk enterprise nix defaults'
- it { is_expected.not_to contain_package('net-tools') }
- it { is_expected.to contain_class('splunk::enterprise').with(service_name: 'splunk') }
- it { is_expected.not_to contain_file('/etc/init.d/splunk').with(ensure: 'absent') }
- it { is_expected.not_to contain_exec('stop_splunk') }
- it { is_expected.not_to contain_exec('enable_splunk') }
- it { is_expected.to contain_exec('disable_splunk').with(command: '/opt/splunk/bin/splunk disable boot-start -user root --accept-license --answer-yes --no-prompt') }
- it { is_expected.to contain_exec('license_splunk').with(command: '/opt/splunk/bin/splunk start --accept-license --answer-yes --no-prompt') }
- it { is_expected.to contain_service('splunk').with(restart: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk restart'", start: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk start'", stop: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk stop'", status: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk status'") }
- end
-
- context 'with $facts[service_provider] == systemd and $splunk::params::version >= 7.2.2' do
- let(:facts) do
- facts.merge(service_provider: 'systemd')
- end
- let(:pre_condition) do
- "class { 'splunk::params': version => '7.2.4.2', boot_start => false }"
- end
-
- it_behaves_like 'splunk enterprise nix defaults'
- it { is_expected.to contain_package('net-tools').with(ensure: 'installed') }
- it { is_expected.to contain_class('splunk::enterprise').with(service_name: 'Splunkd') }
- it { is_expected.to contain_file('/etc/init.d/splunk').with(ensure: 'absent') }
- it { is_expected.not_to contain_exec('stop_splunk') }
- it { is_expected.not_to contain_exec('enable_splunk') }
- it { is_expected.to contain_exec('disable_splunk').with(command: '/opt/splunk/bin/splunk disable boot-start -user root --accept-license --answer-yes --no-prompt') }
- it { is_expected.to contain_exec('license_splunk').with(command: '/opt/splunk/bin/splunk start --accept-license --answer-yes --no-prompt') }
- it { is_expected.to contain_service('Splunkd').with(restart: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk restart'", start: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk start'", stop: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk stop'", status: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk status'") }
- end
-
- context 'with $facts[service_provider] == systemd and $splunk::params::version >= 7.2.2 and manage_net_tools == false' do
- let(:facts) do
- facts.merge(service_provider: 'systemd')
- end
- let(:pre_condition) do
- "class { 'splunk::params': version => '7.2.4.2', boot_start => false, manage_net_tools => false }"
- end
-
- it_behaves_like 'splunk enterprise nix defaults'
- it { is_expected.not_to contain_package('net-tools') }
- it { is_expected.to contain_class('splunk::enterprise').with(service_name: 'Splunkd') }
- it { is_expected.to contain_file('/etc/init.d/splunk').with(ensure: 'absent') }
- it { is_expected.not_to contain_exec('stop_splunk') }
- it { is_expected.not_to contain_exec('enable_splunk') }
- it { is_expected.to contain_exec('disable_splunk').with(command: '/opt/splunk/bin/splunk disable boot-start -user root --accept-license --answer-yes --no-prompt') }
- it { is_expected.to contain_exec('license_splunk').with(command: '/opt/splunk/bin/splunk start --accept-license --answer-yes --no-prompt') }
- it { is_expected.to contain_service('Splunkd').with(restart: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk restart'", start: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk start'", stop: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk stop'", status: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk status'") }
- end
-
- context 'with $facts[service_provider] == systemd and $splunk::params::version < 7.2.2' do
- let(:facts) do
- facts.merge(service_provider: 'systemd')
- end
- let(:pre_condition) do
- "class { 'splunk::params': version => '6.0.0', boot_start => false }"
- end
-
- it_behaves_like 'splunk enterprise nix defaults'
- it { is_expected.not_to contain_package('net-tools').with(ensure: 'installed') }
- it { is_expected.to contain_class('splunk::enterprise').with(service_name: 'splunk') }
- it { is_expected.not_to contain_file('/etc/init.d/splunk').with(ensure: 'absent') }
- it { is_expected.not_to contain_exec('stop_splunk') }
- it { is_expected.not_to contain_exec('enable_splunk') }
- it { is_expected.to contain_exec('disable_splunk').with(command: '/opt/splunk/bin/splunk disable boot-start -user root --accept-license --answer-yes --no-prompt') }
- it { is_expected.to contain_exec('license_splunk').with(command: '/opt/splunk/bin/splunk start --accept-license --answer-yes --no-prompt') }
- it { is_expected.to contain_service('splunk').with(restart: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk restart'", start: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk start'", stop: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk stop'", status: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk status'") }
- end
-
- context 'with $facts[service_provider] == systemd and $splunk::params::version < 7.2.2 and manage_net_tools == false' do
- let(:facts) do
- facts.merge(service_provider: 'systemd')
- end
- let(:pre_condition) do
- "class { 'splunk::params': version => '6.0.0', boot_start => false, manage_net_tools => false }"
- end
-
- it_behaves_like 'splunk enterprise nix defaults'
- it { is_expected.not_to contain_package('net-tools') }
- it { is_expected.to contain_class('splunk::enterprise').with(service_name: 'splunk') }
- it { is_expected.not_to contain_file('/etc/init.d/splunk').with(ensure: 'absent') }
- it { is_expected.not_to contain_exec('stop_splunk') }
- it { is_expected.not_to contain_exec('enable_splunk') }
- it { is_expected.to contain_exec('disable_splunk').with(command: '/opt/splunk/bin/splunk disable boot-start -user root --accept-license --answer-yes --no-prompt') }
- it { is_expected.to contain_exec('license_splunk').with(command: '/opt/splunk/bin/splunk start --accept-license --answer-yes --no-prompt') }
- it { is_expected.to contain_service('splunk').with(restart: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk restart'", start: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk start'", stop: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk stop'", status: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk status'") }
+ context 'with $facts[service_provider] == init and $splunk::params::version >= 7.2.2' do
+ let(:facts) do
+ facts.merge(service_provider: 'init')
+ end
+ let(:pre_condition) do
+ "class { 'splunk::params': version => '7.2.4.2', boot_start => false }"
end
+ it_behaves_like 'splunk enterprise nix defaults'
+ it { is_expected.to contain_package('net-tools').with(ensure: 'installed') }
+ it { is_expected.to contain_class('splunk::enterprise').with(service_name: 'splunk') }
+ it { is_expected.not_to contain_file('/etc/init.d/splunk').with(ensure: 'absent') }
+ it { is_expected.not_to contain_exec('stop_splunk') }
+ it { is_expected.not_to contain_exec('enable_splunk') }
+ it { is_expected.to contain_exec('disable_splunk').with(command: '/opt/splunk/bin/splunk disable boot-start -user root --accept-license --answer-yes --no-prompt') }
+ it { is_expected.to contain_exec('license_splunk').with(command: '/opt/splunk/bin/splunk start --accept-license --answer-yes --no-prompt') }
+ it { is_expected.to contain_service('splunk').with(restart: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk restart'", start: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk start'", stop: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk stop'", status: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk status'") }
end
+
+ context 'with $facts[service_provider] == init and $splunk::params::version >= 7.2.2 and manage_net_tools == false' do
+ let(:facts) do
+ facts.merge(service_provider: 'init')
+ end
+ let(:pre_condition) do
+ "class { 'splunk::params': version => '7.2.4.2', boot_start => false, manage_net_tools => false }"
+ end
+
+ it_behaves_like 'splunk enterprise nix defaults'
+ it { is_expected.not_to contain_package('net-tools') }
+ it { is_expected.to contain_class('splunk::enterprise').with(service_name: 'splunk') }
+ it { is_expected.not_to contain_file('/etc/init.d/splunk').with(ensure: 'absent') }
+ it { is_expected.not_to contain_exec('stop_splunk') }
+ it { is_expected.not_to contain_exec('enable_splunk') }
+ it { is_expected.to contain_exec('disable_splunk').with(command: '/opt/splunk/bin/splunk disable boot-start -user root --accept-license --answer-yes --no-prompt') }
+ it { is_expected.to contain_exec('license_splunk').with(command: '/opt/splunk/bin/splunk start --accept-license --answer-yes --no-prompt') }
+ it { is_expected.to contain_service('splunk').with(restart: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk restart'", start: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk start'", stop: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk stop'", status: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk status'") }
+ end
+
+ context 'with $facts[service_provider] == init and $splunk::params::version < 7.2.2' do
+ let(:facts) do
+ facts.merge(service_provider: 'init')
+ end
+ let(:pre_condition) do
+ "class { 'splunk::params': version => '6.0.0', boot_start => false }"
+ end
+
+ it_behaves_like 'splunk enterprise nix defaults'
+ it { is_expected.not_to contain_package('net-tools').with(ensure: 'installed') }
+ it { is_expected.to contain_class('splunk::enterprise').with(service_name: 'splunk') }
+ it { is_expected.not_to contain_file('/etc/init.d/splunk').with(ensure: 'absent') }
+ it { is_expected.not_to contain_exec('stop_splunk') }
+ it { is_expected.not_to contain_exec('enable_splunk') }
+ it { is_expected.to contain_exec('disable_splunk').with(command: '/opt/splunk/bin/splunk disable boot-start -user root --accept-license --answer-yes --no-prompt') }
+ it { is_expected.to contain_exec('license_splunk').with(command: '/opt/splunk/bin/splunk start --accept-license --answer-yes --no-prompt') }
+ it { is_expected.to contain_service('splunk').with(restart: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk restart'", start: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk start'", stop: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk stop'", status: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk status'") }
+ end
+
+ context 'with $facts[service_provider] == init and $splunk::params::version < 7.2.2 and manage_net_tools == false' do
+ let(:facts) do
+ facts.merge(service_provider: 'init')
+ end
+ let(:pre_condition) do
+ "class { 'splunk::params': version => '6.0.0', boot_start => false, manage_net_tools => false }"
+ end
+
+ it_behaves_like 'splunk enterprise nix defaults'
+ it { is_expected.not_to contain_package('net-tools') }
+ it { is_expected.to contain_class('splunk::enterprise').with(service_name: 'splunk') }
+ it { is_expected.not_to contain_file('/etc/init.d/splunk').with(ensure: 'absent') }
+ it { is_expected.not_to contain_exec('stop_splunk') }
+ it { is_expected.not_to contain_exec('enable_splunk') }
+ it { is_expected.to contain_exec('disable_splunk').with(command: '/opt/splunk/bin/splunk disable boot-start -user root --accept-license --answer-yes --no-prompt') }
+ it { is_expected.to contain_exec('license_splunk').with(command: '/opt/splunk/bin/splunk start --accept-license --answer-yes --no-prompt') }
+ it { is_expected.to contain_service('splunk').with(restart: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk restart'", start: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk start'", stop: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk stop'", status: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk status'") }
+ end
+
+ context 'with $facts[service_provider] == systemd and $splunk::params::version >= 7.2.2' do
+ let(:facts) do
+ facts.merge(service_provider: 'systemd')
+ end
+ let(:pre_condition) do
+ "class { 'splunk::params': version => '7.2.4.2', boot_start => false }"
+ end
+
+ it_behaves_like 'splunk enterprise nix defaults'
+ it { is_expected.to contain_package('net-tools').with(ensure: 'installed') }
+ it { is_expected.to contain_class('splunk::enterprise').with(service_name: 'Splunkd') }
+ it { is_expected.to contain_file('/etc/init.d/splunk').with(ensure: 'absent') }
+ it { is_expected.not_to contain_exec('stop_splunk') }
+ it { is_expected.not_to contain_exec('enable_splunk') }
+ it { is_expected.to contain_exec('disable_splunk').with(command: '/opt/splunk/bin/splunk disable boot-start -user root --accept-license --answer-yes --no-prompt') }
+ it { is_expected.to contain_exec('license_splunk').with(command: '/opt/splunk/bin/splunk start --accept-license --answer-yes --no-prompt') }
+ it { is_expected.to contain_service('Splunkd').with(restart: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk restart'", start: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk start'", stop: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk stop'", status: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk status'") }
+ end
+
+ context 'with $facts[service_provider] == systemd and $splunk::params::version >= 7.2.2 and manage_net_tools == false' do
+ let(:facts) do
+ facts.merge(service_provider: 'systemd')
+ end
+ let(:pre_condition) do
+ "class { 'splunk::params': version => '7.2.4.2', boot_start => false, manage_net_tools => false }"
+ end
+
+ it_behaves_like 'splunk enterprise nix defaults'
+ it { is_expected.not_to contain_package('net-tools') }
+ it { is_expected.to contain_class('splunk::enterprise').with(service_name: 'Splunkd') }
+ it { is_expected.to contain_file('/etc/init.d/splunk').with(ensure: 'absent') }
+ it { is_expected.not_to contain_exec('stop_splunk') }
+ it { is_expected.not_to contain_exec('enable_splunk') }
+ it { is_expected.to contain_exec('disable_splunk').with(command: '/opt/splunk/bin/splunk disable boot-start -user root --accept-license --answer-yes --no-prompt') }
+ it { is_expected.to contain_exec('license_splunk').with(command: '/opt/splunk/bin/splunk start --accept-license --answer-yes --no-prompt') }
+ it { is_expected.to contain_service('Splunkd').with(restart: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk restart'", start: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk start'", stop: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk stop'", status: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk status'") }
+ end
+
+ context 'with $facts[service_provider] == systemd and $splunk::params::version < 7.2.2' do
+ let(:facts) do
+ facts.merge(service_provider: 'systemd')
+ end
+ let(:pre_condition) do
+ "class { 'splunk::params': version => '6.0.0', boot_start => false }"
+ end
+
+ it_behaves_like 'splunk enterprise nix defaults'
+ it { is_expected.not_to contain_package('net-tools').with(ensure: 'installed') }
+ it { is_expected.to contain_class('splunk::enterprise').with(service_name: 'splunk') }
+ it { is_expected.not_to contain_file('/etc/init.d/splunk').with(ensure: 'absent') }
+ it { is_expected.not_to contain_exec('stop_splunk') }
+ it { is_expected.not_to contain_exec('enable_splunk') }
+ it { is_expected.to contain_exec('disable_splunk').with(command: '/opt/splunk/bin/splunk disable boot-start -user root --accept-license --answer-yes --no-prompt') }
+ it { is_expected.to contain_exec('license_splunk').with(command: '/opt/splunk/bin/splunk start --accept-license --answer-yes --no-prompt') }
+ it { is_expected.to contain_service('splunk').with(restart: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk restart'", start: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk start'", stop: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk stop'", status: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk status'") }
+ end
+
+ context 'with $facts[service_provider] == systemd and $splunk::params::version < 7.2.2 and manage_net_tools == false' do
+ let(:facts) do
+ facts.merge(service_provider: 'systemd')
+ end
+ let(:pre_condition) do
+ "class { 'splunk::params': version => '6.0.0', boot_start => false, manage_net_tools => false }"
+ end
+
+ it_behaves_like 'splunk enterprise nix defaults'
+ it { is_expected.not_to contain_package('net-tools') }
+ it { is_expected.to contain_class('splunk::enterprise').with(service_name: 'splunk') }
+ it { is_expected.not_to contain_file('/etc/init.d/splunk').with(ensure: 'absent') }
+ it { is_expected.not_to contain_exec('stop_splunk') }
+ it { is_expected.not_to contain_exec('enable_splunk') }
+ it { is_expected.to contain_exec('disable_splunk').with(command: '/opt/splunk/bin/splunk disable boot-start -user root --accept-license --answer-yes --no-prompt') }
+ it { is_expected.to contain_exec('license_splunk').with(command: '/opt/splunk/bin/splunk start --accept-license --answer-yes --no-prompt') }
+ it { is_expected.to contain_service('splunk').with(restart: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk restart'", start: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk start'", stop: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk stop'", status: "/usr/sbin/runuser -l root -c '/opt/splunk/bin/splunk status'") }
+ end
+
end
end
end
diff --git a/spec/classes/forwarder_spec.rb b/spec/classes/forwarder_spec.rb
index f8ce9c57..fe763296 100644
--- a/spec/classes/forwarder_spec.rb
+++ b/spec/classes/forwarder_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
shared_examples_for 'splunk forwarder' do
@@ -27,260 +29,258 @@
describe 'splunk::forwarder' do
context 'supported operating systems' do
on_supported_os.each do |os, facts|
- if os.start_with?('windows')
- # Splunk Server not used supported on windows
- else
- context "on #{os}" do
- let(:facts) do
- facts
- end
+ next if facts[:os]['name'] == 'windows' # Splunk Server not used supported on windows
- context 'splunk when including forwarder and enterprise' do
- let(:pre_condition) do
- 'include splunk::enterprise'
- end
+ context "on #{os}" do
+ let(:facts) do
+ facts
+ end
- it { is_expected.to compile.and_raise_error(%r{Do not include splunk::forwarder on the same node as splunk::enterprise}) }
+ context 'splunk when including forwarder and enterprise' do
+ let(:pre_condition) do
+ 'include splunk::enterprise'
end
- context 'when manage_password = true' do
- if facts[:kernel] == 'Linux' || facts[:kernel] == 'SunOS'
- let(:params) { { 'manage_password' => true } }
+ it { is_expected.to compile.and_raise_error(%r{Do not include splunk::forwarder on the same node as splunk::enterprise}) }
+ end
- it { is_expected.to compile.with_all_deps }
- it { is_expected.to contain_file('/opt/splunkforwarder/etc/splunk.secret') }
- it { is_expected.to contain_file('/opt/splunkforwarder/etc/passwd') }
- end
+ context 'when manage_password = true' do
+ if facts[:kernel] == 'Linux' || facts[:kernel] == 'SunOS'
+ let(:params) { { 'manage_password' => true } }
+
+ it { is_expected.to compile.with_all_deps }
+ it { is_expected.to contain_file('/opt/splunkforwarder/etc/splunk.secret') }
+ it { is_expected.to contain_file('/opt/splunkforwarder/etc/passwd') }
end
+ end
- context 'when package_provider = yum' do
- if facts[:kernel] == 'Linux' || facts[:kernel] == 'SunOS'
- let(:params) { { 'package_provider' => 'yum' } }
+ context 'when package_provider = yum' do
+ if facts[:kernel] == 'Linux' || facts[:kernel] == 'SunOS'
+ let(:params) { { 'package_provider' => 'yum' } }
- it { is_expected.to contain_package('splunkforwarder').with(provider: 'yum') }
- end
+ it { is_expected.to contain_package('splunkforwarder').with(provider: 'yum') }
end
+ end
- context 'with $boot_start = true (defaults)' do
- if facts[:kernel] == 'Linux' || facts[:kernel] == 'SunOS'
-
- context 'with $facts[service_provider] == init and $splunk::params::version >= 7.2.2' do
- let(:facts) do
- facts.merge(service_provider: 'init')
- end
- let(:pre_condition) do
- "class { 'splunk::params': version => '7.2.2' }"
- end
-
- it_behaves_like 'splunk forwarder'
- it { is_expected.to contain_class('splunk::forwarder::service::nix') }
- it { is_expected.to contain_class('splunk::forwarder').with(service_name: 'splunk') }
- it { is_expected.to contain_exec('stop_splunkforwarder').with(command: '/opt/splunkforwarder/bin/splunk stop') }
- it { is_expected.to contain_exec('enable_splunkforwarder').with(command: '/opt/splunkforwarder/bin/splunk enable boot-start -user root --accept-license --answer-yes --no-prompt') }
- it { is_expected.not_to contain_exec('disable_splunkforwarder') }
- it { is_expected.not_to contain_exec('license_splunkforwarder') }
- it { is_expected.to contain_service('splunk').with(ensure: 'running', enable: true, status: nil, restart: nil, start: nil, stop: nil) }
+ context 'with $boot_start = true (defaults)' do
+ if facts[:kernel] == 'Linux' || facts[:kernel] == 'SunOS'
+
+ context 'with $facts[service_provider] == init and $splunk::params::version >= 7.2.2' do
+ let(:facts) do
+ facts.merge(service_provider: 'init')
+ end
+ let(:pre_condition) do
+ "class { 'splunk::params': version => '7.2.2' }"
end
- context 'with $facts[service_provider] == init and $splunk::params::version < 7.2.2' do
- let(:facts) do
- facts.merge(service_provider: 'init')
- end
- let(:pre_condition) do
- "class { 'splunk::params': version => '6.0.0' }"
- end
-
- it_behaves_like 'splunk forwarder'
- it { is_expected.to contain_class('splunk::forwarder::service::nix') }
- it { is_expected.to contain_class('splunk::forwarder').with(service_name: 'splunk') }
- it { is_expected.to contain_exec('stop_splunkforwarder').with(command: '/opt/splunkforwarder/bin/splunk stop') }
- it { is_expected.to contain_exec('enable_splunkforwarder').with(command: '/opt/splunkforwarder/bin/splunk enable boot-start -user root --accept-license --answer-yes --no-prompt') }
- it { is_expected.not_to contain_exec('disable_splunkforwarder') }
- it { is_expected.not_to contain_exec('license_splunkforwarder') }
- it { is_expected.to contain_service('splunk').with(ensure: 'running', enable: true, status: nil, restart: nil, start: nil, stop: nil) }
+ it_behaves_like 'splunk forwarder'
+ it { is_expected.to contain_class('splunk::forwarder::service::nix') }
+ it { is_expected.to contain_class('splunk::forwarder').with(service_name: 'splunk') }
+ it { is_expected.to contain_exec('stop_splunkforwarder').with(command: '/opt/splunkforwarder/bin/splunk stop') }
+ it { is_expected.to contain_exec('enable_splunkforwarder').with(command: '/opt/splunkforwarder/bin/splunk enable boot-start -user root --accept-license --answer-yes --no-prompt') }
+ it { is_expected.not_to contain_exec('disable_splunkforwarder') }
+ it { is_expected.not_to contain_exec('license_splunkforwarder') }
+ it { is_expected.to contain_service('splunk').with(ensure: 'running', enable: true, status: nil, restart: nil, start: nil, stop: nil) }
+ end
+
+ context 'with $facts[service_provider] == init and $splunk::params::version < 7.2.2' do
+ let(:facts) do
+ facts.merge(service_provider: 'init')
end
+ let(:pre_condition) do
+ "class { 'splunk::params': version => '6.0.0' }"
+ end
+
+ it_behaves_like 'splunk forwarder'
+ it { is_expected.to contain_class('splunk::forwarder::service::nix') }
+ it { is_expected.to contain_class('splunk::forwarder').with(service_name: 'splunk') }
+ it { is_expected.to contain_exec('stop_splunkforwarder').with(command: '/opt/splunkforwarder/bin/splunk stop') }
+ it { is_expected.to contain_exec('enable_splunkforwarder').with(command: '/opt/splunkforwarder/bin/splunk enable boot-start -user root --accept-license --answer-yes --no-prompt') }
+ it { is_expected.not_to contain_exec('disable_splunkforwarder') }
+ it { is_expected.not_to contain_exec('license_splunkforwarder') }
+ it { is_expected.to contain_service('splunk').with(ensure: 'running', enable: true, status: nil, restart: nil, start: nil, stop: nil) }
+ end
- context 'with $facts[service_provider] == systemd and $splunk::params::version >= 7.2.2' do
- let(:facts) do
- facts.merge(service_provider: 'systemd')
- end
- let(:pre_condition) do
- "class { 'splunk::params': version => '7.2.2' }"
- end
-
- it_behaves_like 'splunk forwarder'
- it { is_expected.to contain_class('splunk::forwarder::service::nix') }
- it { is_expected.to contain_class('splunk::forwarder').with(service_name: 'SplunkForwarder') }
- it { is_expected.to contain_exec('stop_splunkforwarder').with(command: '/opt/splunkforwarder/bin/splunk stop') }
- it { is_expected.to contain_exec('enable_splunkforwarder').with(command: '/opt/splunkforwarder/bin/splunk enable boot-start -user root -systemd-managed 1 --accept-license --answer-yes --no-prompt') }
- it { is_expected.not_to contain_exec('disable_splunkforwarder') }
- it { is_expected.not_to contain_exec('license_splunkforwarder') }
- it { is_expected.to contain_service('SplunkForwarder').with(ensure: 'running', enable: true, status: nil, restart: nil, start: nil, stop: nil) }
+ context 'with $facts[service_provider] == systemd and $splunk::params::version >= 7.2.2' do
+ let(:facts) do
+ facts.merge(service_provider: 'systemd')
+ end
+ let(:pre_condition) do
+ "class { 'splunk::params': version => '7.2.2' }"
end
- context 'with $facts[service_provider] == systemd and $splunk::params::version >= 7.2.2 and user != root' do
- let(:facts) do
- facts.merge(service_provider: 'systemd')
- end
- let(:pre_condition) do
- "class { 'splunk::params': version => '7.2.2' }"
- end
- let(:params) { { splunk_user: 'splunk' } }
+ it_behaves_like 'splunk forwarder'
+ it { is_expected.to contain_class('splunk::forwarder::service::nix') }
+ it { is_expected.to contain_class('splunk::forwarder').with(service_name: 'SplunkForwarder') }
+ it { is_expected.to contain_exec('stop_splunkforwarder').with(command: '/opt/splunkforwarder/bin/splunk stop') }
+ it { is_expected.to contain_exec('enable_splunkforwarder').with(command: '/opt/splunkforwarder/bin/splunk enable boot-start -user root -systemd-managed 1 --accept-license --answer-yes --no-prompt') }
+ it { is_expected.not_to contain_exec('disable_splunkforwarder') }
+ it { is_expected.not_to contain_exec('license_splunkforwarder') }
+ it { is_expected.to contain_service('SplunkForwarder').with(ensure: 'running', enable: true, status: nil, restart: nil, start: nil, stop: nil) }
+ end
- it { is_expected.to contain_exec('enable_splunkforwarder').with(command: '/opt/splunkforwarder/bin/splunk enable boot-start -user splunk -systemd-managed 1 --accept-license --answer-yes --no-prompt') }
+ context 'with $facts[service_provider] == systemd and $splunk::params::version >= 7.2.2 and user != root' do
+ let(:facts) do
+ facts.merge(service_provider: 'systemd')
+ end
+ let(:pre_condition) do
+ "class { 'splunk::params': version => '7.2.2' }"
end
+ let(:params) { { splunk_user: 'splunk' } }
+
+ it { is_expected.to contain_exec('enable_splunkforwarder').with(command: '/opt/splunkforwarder/bin/splunk enable boot-start -user splunk -systemd-managed 1 --accept-license --answer-yes --no-prompt') }
+ end
- context 'with $facts[service_provider] == systemd and $splunk::params::version < 7.2.2' do
- let(:facts) do
- facts.merge(service_provider: 'systemd')
- end
- let(:pre_condition) do
- "class { 'splunk::params': version => '6.0.0' }"
- end
-
- it_behaves_like 'splunk forwarder'
- it { is_expected.to contain_class('splunk::forwarder::service::nix') }
- it { is_expected.to contain_class('splunk::forwarder').with(service_name: 'splunk') }
- it { is_expected.to contain_exec('stop_splunkforwarder').with(command: '/opt/splunkforwarder/bin/splunk stop') }
- it { is_expected.to contain_exec('enable_splunkforwarder').with(command: '/opt/splunkforwarder/bin/splunk enable boot-start -user root --accept-license --answer-yes --no-prompt') }
- it { is_expected.not_to contain_exec('disable_splunkforwarder') }
- it { is_expected.not_to contain_exec('license_splunkforwarder') }
- it { is_expected.to contain_service('splunk').with(ensure: 'running', enable: true, status: nil, restart: nil, start: nil, stop: nil) }
+ context 'with $facts[service_provider] == systemd and $splunk::params::version < 7.2.2' do
+ let(:facts) do
+ facts.merge(service_provider: 'systemd')
+ end
+ let(:pre_condition) do
+ "class { 'splunk::params': version => '6.0.0' }"
end
+ it_behaves_like 'splunk forwarder'
+ it { is_expected.to contain_class('splunk::forwarder::service::nix') }
+ it { is_expected.to contain_class('splunk::forwarder').with(service_name: 'splunk') }
+ it { is_expected.to contain_exec('stop_splunkforwarder').with(command: '/opt/splunkforwarder/bin/splunk stop') }
+ it { is_expected.to contain_exec('enable_splunkforwarder').with(command: '/opt/splunkforwarder/bin/splunk enable boot-start -user root --accept-license --answer-yes --no-prompt') }
+ it { is_expected.not_to contain_exec('disable_splunkforwarder') }
+ it { is_expected.not_to contain_exec('license_splunkforwarder') }
+ it { is_expected.to contain_service('splunk').with(ensure: 'running', enable: true, status: nil, restart: nil, start: nil, stop: nil) }
end
+
end
+ end
+
+ context 'with $boot_start = false' do
+ if facts[:kernel] == 'Linux' || facts[:kernel] == 'SunOS'
- context 'with $boot_start = false' do
- if facts[:kernel] == 'Linux' || facts[:kernel] == 'SunOS'
-
- context 'with $facts[service_provider] == init and $splunk::params::version >= 7.2.2' do
- let(:facts) do
- facts.merge(service_provider: 'init')
- end
- let(:pre_condition) do
- "class { 'splunk::params': version => '7.2.2', boot_start => false }"
- end
-
- it_behaves_like 'splunk forwarder'
- it { is_expected.to contain_class('splunk::forwarder::service::nix') }
- it { is_expected.to contain_class('splunk::forwarder').with(service_name: 'splunk') }
- it { is_expected.not_to contain_exec('stop_splunkforwarder') }
- it { is_expected.not_to contain_exec('enable_splunkforwarder') }
- it { is_expected.to contain_exec('disable_splunkforwarder').with(command: '/opt/splunkforwarder/bin/splunk disable boot-start -user root --accept-license --answer-yes --no-prompt') }
- it { is_expected.to contain_exec('license_splunkforwarder').with(command: '/opt/splunkforwarder/bin/splunk ftr --accept-license --answer-yes --no-prompt') }
- it { is_expected.to contain_service('splunk').with(restart: "/usr/sbin/runuser -l root -c '/opt/splunkforwarder/bin/splunk restart'", start: "/usr/sbin/runuser -l root -c '/opt/splunkforwarder/bin/splunk start'", stop: "/usr/sbin/runuser -l root -c '/opt/splunkforwarder/bin/splunk stop'", status: "/usr/sbin/runuser -l root -c '/opt/splunkforwarder/bin/splunk status'") }
+ context 'with $facts[service_provider] == init and $splunk::params::version >= 7.2.2' do
+ let(:facts) do
+ facts.merge(service_provider: 'init')
end
+ let(:pre_condition) do
+ "class { 'splunk::params': version => '7.2.2', boot_start => false }"
+ end
+
+ it_behaves_like 'splunk forwarder'
+ it { is_expected.to contain_class('splunk::forwarder::service::nix') }
+ it { is_expected.to contain_class('splunk::forwarder').with(service_name: 'splunk') }
+ it { is_expected.not_to contain_exec('stop_splunkforwarder') }
+ it { is_expected.not_to contain_exec('enable_splunkforwarder') }
+ it { is_expected.to contain_exec('disable_splunkforwarder').with(command: '/opt/splunkforwarder/bin/splunk disable boot-start -user root --accept-license --answer-yes --no-prompt') }
+ it { is_expected.to contain_exec('license_splunkforwarder').with(command: '/opt/splunkforwarder/bin/splunk ftr --accept-license --answer-yes --no-prompt') }
+ it { is_expected.to contain_service('splunk').with(restart: "/usr/sbin/runuser -l root -c '/opt/splunkforwarder/bin/splunk restart'", start: "/usr/sbin/runuser -l root -c '/opt/splunkforwarder/bin/splunk start'", stop: "/usr/sbin/runuser -l root -c '/opt/splunkforwarder/bin/splunk stop'", status: "/usr/sbin/runuser -l root -c '/opt/splunkforwarder/bin/splunk status'") }
+ end
- context 'with $facts[service_provider] == init and $splunk::params::version < 7.2.2' do
- let(:facts) do
- facts.merge(service_provider: 'init')
- end
- let(:pre_condition) do
- "class { 'splunk::params': version => '6.0.0', boot_start => false }"
- end
-
- it_behaves_like 'splunk forwarder'
- it { is_expected.to contain_class('splunk::forwarder::service::nix') }
- it { is_expected.to contain_class('splunk::forwarder').with(service_name: 'splunk') }
- it { is_expected.not_to contain_exec('stop_splunkforwarder') }
- it { is_expected.not_to contain_exec('enable_splunkforwarder') }
- it { is_expected.to contain_exec('disable_splunkforwarder').with(command: '/opt/splunkforwarder/bin/splunk disable boot-start -user root --accept-license --answer-yes --no-prompt') }
- it { is_expected.to contain_exec('license_splunkforwarder').with(command: '/opt/splunkforwarder/bin/splunk ftr --accept-license --answer-yes --no-prompt') }
- it { is_expected.to contain_service('splunk').with(restart: "/usr/sbin/runuser -l root -c '/opt/splunkforwarder/bin/splunk restart'", start: "/usr/sbin/runuser -l root -c '/opt/splunkforwarder/bin/splunk start'", stop: "/usr/sbin/runuser -l root -c '/opt/splunkforwarder/bin/splunk stop'", status: "/usr/sbin/runuser -l root -c '/opt/splunkforwarder/bin/splunk status'") }
+ context 'with $facts[service_provider] == init and $splunk::params::version < 7.2.2' do
+ let(:facts) do
+ facts.merge(service_provider: 'init')
+ end
+ let(:pre_condition) do
+ "class { 'splunk::params': version => '6.0.0', boot_start => false }"
end
- context 'with $facts[service_provider] == systemd and $splunk::params::version >= 7.2.2' do
- let(:facts) do
- facts.merge(service_provider: 'systemd')
- end
- let(:pre_condition) do
- "class { 'splunk::params': version => '7.2.2', boot_start => false }"
- end
-
- it_behaves_like 'splunk forwarder'
- it { is_expected.to contain_class('splunk::forwarder::service::nix') }
- it { is_expected.to contain_class('splunk::forwarder').with(service_name: 'SplunkForwarder') }
- it { is_expected.not_to contain_exec('stop_splunkforwarder') }
- it { is_expected.not_to contain_exec('enable_splunkforwarder') }
- it { is_expected.to contain_exec('disable_splunkforwarder').with(command: '/opt/splunkforwarder/bin/splunk disable boot-start -user root --accept-license --answer-yes --no-prompt') }
- it { is_expected.to contain_exec('license_splunkforwarder').with(command: '/opt/splunkforwarder/bin/splunk ftr --accept-license --answer-yes --no-prompt') }
- it { is_expected.to contain_service('SplunkForwarder').with(restart: "/usr/sbin/runuser -l root -c '/opt/splunkforwarder/bin/splunk restart'", start: "/usr/sbin/runuser -l root -c '/opt/splunkforwarder/bin/splunk start'", stop: "/usr/sbin/runuser -l root -c '/opt/splunkforwarder/bin/splunk stop'", status: "/usr/sbin/runuser -l root -c '/opt/splunkforwarder/bin/splunk status'") }
+ it_behaves_like 'splunk forwarder'
+ it { is_expected.to contain_class('splunk::forwarder::service::nix') }
+ it { is_expected.to contain_class('splunk::forwarder').with(service_name: 'splunk') }
+ it { is_expected.not_to contain_exec('stop_splunkforwarder') }
+ it { is_expected.not_to contain_exec('enable_splunkforwarder') }
+ it { is_expected.to contain_exec('disable_splunkforwarder').with(command: '/opt/splunkforwarder/bin/splunk disable boot-start -user root --accept-license --answer-yes --no-prompt') }
+ it { is_expected.to contain_exec('license_splunkforwarder').with(command: '/opt/splunkforwarder/bin/splunk ftr --accept-license --answer-yes --no-prompt') }
+ it { is_expected.to contain_service('splunk').with(restart: "/usr/sbin/runuser -l root -c '/opt/splunkforwarder/bin/splunk restart'", start: "/usr/sbin/runuser -l root -c '/opt/splunkforwarder/bin/splunk start'", stop: "/usr/sbin/runuser -l root -c '/opt/splunkforwarder/bin/splunk stop'", status: "/usr/sbin/runuser -l root -c '/opt/splunkforwarder/bin/splunk status'") }
+ end
+
+ context 'with $facts[service_provider] == systemd and $splunk::params::version >= 7.2.2' do
+ let(:facts) do
+ facts.merge(service_provider: 'systemd')
end
+ let(:pre_condition) do
+ "class { 'splunk::params': version => '7.2.2', boot_start => false }"
+ end
+
+ it_behaves_like 'splunk forwarder'
+ it { is_expected.to contain_class('splunk::forwarder::service::nix') }
+ it { is_expected.to contain_class('splunk::forwarder').with(service_name: 'SplunkForwarder') }
+ it { is_expected.not_to contain_exec('stop_splunkforwarder') }
+ it { is_expected.not_to contain_exec('enable_splunkforwarder') }
+ it { is_expected.to contain_exec('disable_splunkforwarder').with(command: '/opt/splunkforwarder/bin/splunk disable boot-start -user root --accept-license --answer-yes --no-prompt') }
+ it { is_expected.to contain_exec('license_splunkforwarder').with(command: '/opt/splunkforwarder/bin/splunk ftr --accept-license --answer-yes --no-prompt') }
+ it { is_expected.to contain_service('SplunkForwarder').with(restart: "/usr/sbin/runuser -l root -c '/opt/splunkforwarder/bin/splunk restart'", start: "/usr/sbin/runuser -l root -c '/opt/splunkforwarder/bin/splunk start'", stop: "/usr/sbin/runuser -l root -c '/opt/splunkforwarder/bin/splunk stop'", status: "/usr/sbin/runuser -l root -c '/opt/splunkforwarder/bin/splunk status'") }
+ end
- context 'with $facts[service_provider] == systemd and $splunk::params::version < 7.2.2' do
- let(:facts) do
- facts.merge(service_provider: 'systemd')
- end
- let(:pre_condition) do
- "class { 'splunk::params': version => '6.0.0', boot_start => false }"
- end
-
- it_behaves_like 'splunk forwarder'
- it { is_expected.to contain_class('splunk::forwarder::service::nix') }
- it { is_expected.to contain_class('splunk::forwarder').with(service_name: 'splunk') }
- it { is_expected.not_to contain_exec('stop_splunkforwarder') }
- it { is_expected.not_to contain_exec('enable_splunkforwarder') }
- it { is_expected.to contain_exec('disable_splunkforwarder').with(command: '/opt/splunkforwarder/bin/splunk disable boot-start -user root --accept-license --answer-yes --no-prompt') }
- it { is_expected.to contain_exec('license_splunkforwarder').with(command: '/opt/splunkforwarder/bin/splunk ftr --accept-license --answer-yes --no-prompt') }
- it { is_expected.to contain_service('splunk').with(restart: "/usr/sbin/runuser -l root -c '/opt/splunkforwarder/bin/splunk restart'", start: "/usr/sbin/runuser -l root -c '/opt/splunkforwarder/bin/splunk start'", stop: "/usr/sbin/runuser -l root -c '/opt/splunkforwarder/bin/splunk stop'", status: "/usr/sbin/runuser -l root -c '/opt/splunkforwarder/bin/splunk status'") }
+ context 'with $facts[service_provider] == systemd and $splunk::params::version < 7.2.2' do
+ let(:facts) do
+ facts.merge(service_provider: 'systemd')
+ end
+ let(:pre_condition) do
+ "class { 'splunk::params': version => '6.0.0', boot_start => false }"
end
+ it_behaves_like 'splunk forwarder'
+ it { is_expected.to contain_class('splunk::forwarder::service::nix') }
+ it { is_expected.to contain_class('splunk::forwarder').with(service_name: 'splunk') }
+ it { is_expected.not_to contain_exec('stop_splunkforwarder') }
+ it { is_expected.not_to contain_exec('enable_splunkforwarder') }
+ it { is_expected.to contain_exec('disable_splunkforwarder').with(command: '/opt/splunkforwarder/bin/splunk disable boot-start -user root --accept-license --answer-yes --no-prompt') }
+ it { is_expected.to contain_exec('license_splunkforwarder').with(command: '/opt/splunkforwarder/bin/splunk ftr --accept-license --answer-yes --no-prompt') }
+ it { is_expected.to contain_service('splunk').with(restart: "/usr/sbin/runuser -l root -c '/opt/splunkforwarder/bin/splunk restart'", start: "/usr/sbin/runuser -l root -c '/opt/splunkforwarder/bin/splunk start'", stop: "/usr/sbin/runuser -l root -c '/opt/splunkforwarder/bin/splunk stop'", status: "/usr/sbin/runuser -l root -c '/opt/splunkforwarder/bin/splunk status'") }
end
+
end
+ end
- context 'when forwarder not already installed' do
- let(:facts) do
- facts.merge(splunkforwarder_version: nil, service_provider: facts[:kernel] == 'FreeBSD' ? 'freebsd' : 'systemd')
- end
- let(:pre_condition) do
- "class { 'splunk::params': version => '7.2.2' }"
- end
- let(:accept_tos_command) do
- '/opt/splunkforwarder/bin/splunk stop && /opt/splunkforwarder/bin/splunk start --accept-license --answer-yes && /opt/splunkforwarder/bin/splunk stop'
- end
- let(:service_name) do
- facts[:kernel] == 'FreeBSD' ? 'splunk' : 'SplunkForwarder'
- end
+ context 'when forwarder not already installed' do
+ let(:facts) do
+ facts.merge(splunkforwarder_version: nil, service_provider: facts[:kernel] == 'FreeBSD' ? 'freebsd' : 'systemd')
+ end
+ let(:pre_condition) do
+ "class { 'splunk::params': version => '7.2.2' }"
+ end
+ let(:accept_tos_command) do
+ '/opt/splunkforwarder/bin/splunk stop && /opt/splunkforwarder/bin/splunk start --accept-license --answer-yes && /opt/splunkforwarder/bin/splunk stop'
+ end
+ let(:service_name) do
+ facts[:kernel] == 'FreeBSD' ? 'splunk' : 'SplunkForwarder'
+ end
- it_behaves_like 'splunk forwarder'
- it do
- is_expected.to contain_exec('splunk-forwarder-accept-tos').with(
- command: accept_tos_command,
- user: 'root',
- before: "Service[#{service_name}]",
- subscribe: nil,
- require: 'Exec[enable_splunkforwarder]',
- refreshonly: 'true'
- )
- end
+ it_behaves_like 'splunk forwarder'
+ it do
+ is_expected.to contain_exec('splunk-forwarder-accept-tos').with(
+ command: accept_tos_command,
+ user: 'root',
+ before: "Service[#{service_name}]",
+ subscribe: nil,
+ require: 'Exec[enable_splunkforwarder]',
+ refreshonly: 'true'
+ )
end
+ end
- context 'when forwarder already installed' do
- let(:facts) do
- facts.merge(splunkforwarder_version: '7.3.3', service_provider: facts[:kernel] == 'FreeBSD' ? 'freebsd' : 'systemd')
- end
- let(:pre_condition) do
- "class { 'splunk::params': version => '7.2.2' }"
- end
- let(:accept_tos_command) do
- '/opt/splunkforwarder/bin/splunk stop && /opt/splunkforwarder/bin/splunk start --accept-license --answer-yes && /opt/splunkforwarder/bin/splunk stop'
- end
- let(:service_name) do
- facts[:kernel] == 'FreeBSD' ? 'splunk' : 'SplunkForwarder'
- end
+ context 'when forwarder already installed' do
+ let(:facts) do
+ facts.merge(splunkforwarder_version: '7.3.3', service_provider: facts[:kernel] == 'FreeBSD' ? 'freebsd' : 'systemd')
+ end
+ let(:pre_condition) do
+ "class { 'splunk::params': version => '7.2.2' }"
+ end
+ let(:accept_tos_command) do
+ '/opt/splunkforwarder/bin/splunk stop && /opt/splunkforwarder/bin/splunk start --accept-license --answer-yes && /opt/splunkforwarder/bin/splunk stop'
+ end
+ let(:service_name) do
+ facts[:kernel] == 'FreeBSD' ? 'splunk' : 'SplunkForwarder'
+ end
- it_behaves_like 'splunk forwarder'
- it do
- is_expected.to contain_exec('splunk-forwarder-accept-tos').with(
- command: accept_tos_command,
- user: 'root',
- before: "Service[#{service_name}]",
- subscribe: 'Package[splunkforwarder]',
- require: 'Exec[enable_splunkforwarder]',
- refreshonly: 'true'
- )
- end
+ it_behaves_like 'splunk forwarder'
+ it do
+ is_expected.to contain_exec('splunk-forwarder-accept-tos').with(
+ command: accept_tos_command,
+ user: 'root',
+ before: "Service[#{service_name}]",
+ subscribe: 'Package[splunkforwarder]',
+ require: 'Exec[enable_splunkforwarder]',
+ refreshonly: 'true'
+ )
end
context 'when $splunk::params::manage_net_tools == false' do
diff --git a/spec/classes/splunk_spec.rb b/spec/classes/splunk_spec.rb
index c05c42c5..b3630eae 100644
--- a/spec/classes/splunk_spec.rb
+++ b/spec/classes/splunk_spec.rb
@@ -1,20 +1,20 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'splunk' do
context 'supported operating systems' do
on_supported_os.each do |os, facts|
- if os.start_with?('windows')
- # Splunk Server not used supported on windows
- else
- context "on #{os}" do
- let(:facts) do
- facts
- end
+ next if facts[:os]['name'] == 'windows' # Splunk Server not used supported on windows
+
+ context "on #{os}" do
+ let(:facts) do
+ facts
+ end
- context 'splunk class without any parameters' do
- it { is_expected.to compile.with_all_deps }
- it { is_expected.to contain_class('splunk') }
- end
+ context 'splunk class without any parameters' do
+ it { is_expected.to compile.with_all_deps }
+ it { is_expected.to contain_class('splunk') }
end
end
end
diff --git a/spec/defines/addon_spec.rb b/spec/defines/addon_spec.rb
index 6a5e48f5..631b9b27 100644
--- a/spec/defines/addon_spec.rb
+++ b/spec/defines/addon_spec.rb
@@ -1,20 +1,20 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'splunk::addon' do
context 'fail if class prerequisit not declared' do
on_supported_os.each do |os, facts|
- if os.start_with?('windows')
- # Splunk Server not used supported on windows
- else
- context "on #{os}" do
- let(:facts) do
- facts
- end
- let(:title) { 'Splunk_TA' }
- let(:params) { { 'splunkbase_source' => 'puppet:///modules/profiles/splunk-add-on.tgz' } }
+ next if facts[:os]['name'] == 'windows' # Splunk Server not used supported on windows
- it { is_expected.to compile.and_raise_error(%r{Error while evaluating a Function Call}) }
+ context "on #{os}" do
+ let(:facts) do
+ facts
end
+ let(:title) { 'Splunk_TA' }
+ let(:params) { { 'splunkbase_source' => 'puppet:///modules/profiles/splunk-add-on.tgz' } }
+
+ it { is_expected.to compile.and_raise_error(%r{Error while evaluating a Function Call}) }
end
end
end
@@ -25,32 +25,30 @@
end
on_supported_os.each do |os, facts|
- if os.start_with?('windows')
- # Splunk Server not used supported on windows
- else
- context "on #{os}" do
- let(:facts) do
- facts
- end
+ next if facts[:os]['name'] == 'windows' # Splunk Server not used supported on windows
- context 'basic addon' do
- let(:title) { 'Splunk_TA' }
- let(:params) { { 'splunkbase_source' => 'puppet:///modules/profiles/splunk-add-on.tgz' } }
+ context "on #{os}" do
+ let(:facts) do
+ facts
+ end
- it { is_expected.to compile.with_all_deps }
- it { is_expected.to contain_archive('Splunk_TA').with(source: 'puppet:///modules/profiles/splunk-add-on.tgz') }
- end
+ context 'basic addon' do
+ let(:title) { 'Splunk_TA' }
+ let(:params) { { 'splunkbase_source' => 'puppet:///modules/profiles/splunk-add-on.tgz' } }
- context 'addon requiring extract_command' do
- let(:title) { 'Splunk_TA' }
- let(:params) do
- { 'splunkbase_source' => 'puppet:///modules/profiles/splunk-add-on.spl',
- 'extract_command' => 'tar zxf %s' }
- end
+ it { is_expected.to compile.with_all_deps }
+ it { is_expected.to contain_archive('Splunk_TA').with(source: 'puppet:///modules/profiles/splunk-add-on.tgz') }
+ end
- it { is_expected.to compile.with_all_deps }
- it { is_expected.to contain_archive('Splunk_TA').with(source: 'puppet:///modules/profiles/splunk-add-on.spl', extract_command: 'tar zxf %s') }
+ context 'addon requiring extract_command' do
+ let(:title) { 'Splunk_TA' }
+ let(:params) do
+ { 'splunkbase_source' => 'puppet:///modules/profiles/splunk-add-on.spl',
+ 'extract_command' => 'tar zxf %s' }
end
+
+ it { is_expected.to compile.with_all_deps }
+ it { is_expected.to contain_archive('Splunk_TA').with(source: 'puppet:///modules/profiles/splunk-add-on.spl', extract_command: 'tar zxf %s') }
end
end
end
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 75fe9487..9ddfdde9 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,21 +1,24 @@
+# frozen_string_literal: true
+
# Managed by modulesync - DO NOT EDIT
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/
# puppetlabs_spec_helper will set up coverage if the env variable is set.
# We want to do this if lib exists and it hasn't been explicitly set.
-ENV['COVERAGE'] ||= 'yes' if Dir.exist?(File.expand_path('../../lib', __FILE__))
+ENV['COVERAGE'] ||= 'yes' if Dir.exist?(File.expand_path('../lib', __dir__))
require 'voxpupuli/test/spec_helper'
+add_mocked_facts!
+
if File.exist?(File.join(__dir__, 'default_module_facts.yml'))
facts = YAML.safe_load(File.read(File.join(__dir__, 'default_module_facts.yml')))
- if facts
- facts.each do |name, value|
- add_custom_fact name.to_sym, value
- end
+ facts&.each do |name, value|
+ add_custom_fact name.to_sym, value
end
end
-require 'splunk_data.rb'
+require 'splunk_data'
$LOAD_PATH.unshift File.dirname(__FILE__) + '/fixtures/modules/inifile/lib'
+Dir['./spec/support/spec/**/*.rb'].sort.each { |f| require f }
diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb
index ceee61f7..707feaae 100644
--- a/spec/spec_helper_acceptance.rb
+++ b/spec/spec_helper_acceptance.rb
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
require 'voxpupuli/acceptance/spec_helper_acceptance'
-require 'splunk_data.rb'
+require 'splunk_data'
configure_beaker do |host|
# Need to stage the Splunk/Splunkforwarder packages here.
diff --git a/spec/splunk_data.rb b/spec/splunk_data.rb
index 2d2c3cea..8f3711c4 100644
--- a/spec/splunk_data.rb
+++ b/spec/splunk_data.rb
@@ -1,3 +1,4 @@
+# frozen_string_literal: true
SPLUNK_SERVER_TYPES = {
splunk_alert_actions: 'alert_actions.conf',
diff --git a/spec/unit/facter/splunk_version_spec.rb b/spec/unit/facter/splunk_version_spec.rb
index aabd8a69..a4634114 100644
--- a/spec/unit/facter/splunk_version_spec.rb
+++ b/spec/unit/facter/splunk_version_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'splunk_version Fact' do
diff --git a/spec/unit/facter/splunkforwarder_version_spec.rb b/spec/unit/facter/splunkforwarder_version_spec.rb
index b3bc72a0..028196be 100644
--- a/spec/unit/facter/splunkforwarder_version_spec.rb
+++ b/spec/unit/facter/splunkforwarder_version_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe 'splunkforwarder_version Fact' do
diff --git a/spec/unit/puppet/type/splunk_config_spec.rb b/spec/unit/puppet/type/splunk_config_spec.rb
index 18f91bd9..a19f6bc7 100644
--- a/spec/unit/puppet/type/splunk_config_spec.rb
+++ b/spec/unit/puppet/type/splunk_config_spec.rb
@@ -1,7 +1,9 @@
+# frozen_string_literal: true
+
require 'spec_helper'
describe Puppet::Type.type(:splunk_config) do
- let(:subject) do
+ let(:subject) do # rubocop:disable RSpec/SubjectDeclaration
described_class.new(
name: 'config',
server_confdir: '/opt/splunk/etc',
@@ -26,7 +28,7 @@
file_path = File.join('/opt/splunkforwarder/etc/system/local', file_name)
end
- it "should configure the #{type} type with file path #{file_path}" do
+ it "configures the #{type} type with file path #{file_path}" do
resource = Puppet::Type.type(type).new(name: 'foo', setting: 'foo', section: 'foo')
provider = Puppet::Type.type(type).provider(:ini_setting).new(resource)
expect(provider.file_path).to eq(file_path)
diff --git a/spec/unit/puppet/type/splunk_types_spec.rb b/spec/unit/puppet/type/splunk_types_spec.rb
index 76b15a90..a5d62d2c 100644
--- a/spec/unit/puppet/type/splunk_types_spec.rb
+++ b/spec/unit/puppet/type/splunk_types_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
# The majority of splunk and splunkforwarder types are identical and inherit
# the same functionality off ini_file, so we don't need individual tests for them
@@ -5,7 +7,7 @@
SPLUNK_TYPES.each do |type, file_name|
describe Puppet::Type.type(type) do
context 'attributes' do
- [:name, :setting, :section, :context].each do |parameter|
+ %i[name setting section context].each do |parameter|
describe parameter.to_s do
it 'has a name attribute' do
expect(described_class.attrclass(parameter)).not_to be_nil
@@ -26,7 +28,7 @@
end
it 'has name, context, setting and section as namevars' do
- expect(described_class.key_attributes.sort).to eq([:context, :name, :section, :setting])
+ expect(described_class.key_attributes.sort).to eq(%i[context name section setting])
end
end
@@ -60,6 +62,7 @@
type = described_class.new(title: 'foo/bar', setting: 'tango', section: 'delta')
expect(type[:section]).to eq('delta')
end
+
it 'ignores title when setting is declared' do
type = described_class.new(title: 'foo/bar', setting: 'tango', section: 'delta')
expect(type[:setting]).to eq('tango')
@@ -76,6 +79,7 @@
it 'has a value property' do
expect(described_class.attrtype(:value)).to eq(:property)
end
+
context 'when testing value is insync' do
let(:resource) { described_class.new(title: 'foo/bar', value: 'value') }
let(:property) { resource.property(:value) }
@@ -92,6 +96,7 @@
property.should = 'value'
expect(property).to be_safe_insync('value')
end
+
it 'is insync if encrypted `is` value matches `should` value after being decrypted' do
property.should = 'temp1234'
allow(File).to receive(:file?).with(%r{/opt/splunk(forwarder)?/etc/auth/splunk\.secret$}).and_return(true)
diff --git a/spec/unit/puppet_x/voxpupuli/splunk/util_spec.rb b/spec/unit/puppet_x/voxpupuli/splunk/util_spec.rb
index 4f44a845..b932b527 100644
--- a/spec/unit/puppet_x/voxpupuli/splunk/util_spec.rb
+++ b/spec/unit/puppet_x/voxpupuli/splunk/util_spec.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'spec_helper'
require 'puppet_x/voxpupuli/splunk/util'
@@ -8,6 +10,7 @@
expect(described_class.decrypt('secrets_file', 'non_encrypted_value')).to eq 'non_encrypted_value'
end
end
+
context 'when called with splunk 7.2 encrypted value' do
let(:encrypted_value) { '$7$aTVkS01HYVNJUk5wSnR5NIu4GXLhj2Qd49n2B6Y8qmA/u1CdL9JYxQ==' }
let(:splunk_secret) { 'JX7cQAnH6Nznmild8MvfN8/BLQnGr8C3UYg3mqvc3ArFkaxj4gUt1RUCaRBD/r0CNn8xOA2oKX8/0uyyChyGRiFKhp6h2FA+ydNIRnN46N8rZov8QGkchmebZa5GAM5U50GbCCgzJFObPyWi5yT8CrSCYmv9cpRtpKyiX+wkhJwltoJzAxWbBERiLp+oXZnN3lsRn6YkljmYBqN9tZLTVVpsLvqvkezPgpv727Fd//5dRoWsWBv2zRp0mwDv3tj' }