Skip to content

Commit

Permalink
Correct splunk.secret path (#378)
Browse files Browse the repository at this point in the history
* update splunk.secret path on Linux

* Update enterprise_spec.rb

Update secret location in spec testing

* Update enterprise_spec.rb

add auth to spec check

* Update forwarder_spec.rb

* Update secret path to etc/auth for all OSes

---------

Co-authored-by: luedderd <[email protected]>
  • Loading branch information
luedderd and luedderd authored Aug 28, 2024
1 parent deb48cf commit b579524
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
16 changes: 8 additions & 8 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@
$enterprise_seed_config_file = "${enterprise_homedir}/etc/system/local/user-seed.conf"
$forwarder_password_config_file = "${forwarder_homedir}/etc/passwd"
$enterprise_password_config_file = "${enterprise_homedir}/etc/passwd"
$forwarder_secret_file = "${forwarder_homedir}/etc/splunk.secret"
$enterprise_secret_file = "${enterprise_homedir}/etc/splunk.secret"
$forwarder_secret_file = "${forwarder_homedir}/etc/auth/splunk.secret"
$enterprise_secret_file = "${enterprise_homedir}/etc/auth/splunk.secret"
$forwarder_confdir = "${forwarder_homedir}/etc"
$enterprise_src_subdir = 'linux'
$enterprise_confdir = "${enterprise_homedir}/etc"
Expand Down Expand Up @@ -191,8 +191,8 @@
$enterprise_seed_config_file = "${enterprise_homedir}/etc/system/local/user-seed.conf"
$forwarder_password_config_file = "${forwarder_homedir}/etc/passwd"
$enterprise_password_config_file = "${enterprise_homedir}/etc/passwd"
$forwarder_secret_file = "${forwarder_homedir}/etc/splunk.secret"
$enterprise_secret_file = "${enterprise_homedir}/etc/splunk.secret"
$forwarder_secret_file = "${forwarder_homedir}/etc/auth/splunk.secret"
$enterprise_secret_file = "${enterprise_homedir}/etc/auth/splunk.secret"
$forwarder_confdir = "${forwarder_homedir}/etc"
$enterprise_src_subdir = 'solaris'
$enterprise_confdir = "${enterprise_homedir}/etc"
Expand Down Expand Up @@ -223,8 +223,8 @@
$enterprise_seed_config_file = "${enterprise_homedir}/etc/system/local/user-seed.conf"
$forwarder_password_config_file = "${forwarder_homedir}/etc/passwd"
$enterprise_password_config_file = "${enterprise_homedir}/etc/passwd"
$forwarder_secret_file = "${forwarder_homedir}/etc/splunk.secret"
$enterprise_secret_file = "${enterprise_homedir}/etc/splunk.secret"
$forwarder_secret_file = "${forwarder_homedir}/etc/auth/splunk.secret"
$enterprise_secret_file = "${enterprise_homedir}/etc/auth/splunk.secret"
$forwarder_confdir = "${forwarder_homedir}/etc"
$enterprise_src_subdir = 'freebsd'
$enterprise_confdir = "${enterprise_homedir}/etc"
Expand All @@ -244,8 +244,8 @@
$enterprise_seed_config_file = "${enterprise_homedir}\\etc\\system\\local\\user-seed.conf"
$forwarder_password_config_file = "${forwarder_homedir}\\etc\\passwd"
$enterprise_password_config_file = "${enterprise_homedir}\\etc\\passwd"
$forwarder_secret_file = "${forwarder_homedir}\\etc\\splunk.secret"
$enterprise_secret_file = "${enterprise_homedir}\\etc\\splunk.secret"
$forwarder_secret_file = "${forwarder_homedir}\\etc\\auth\\splunk.secret"
$enterprise_secret_file = "${enterprise_homedir}\\etc\\auth\\splunk.secret"
$forwarder_service = 'SplunkForwarder'
$forwarder_service_file = "${forwarder_homedir}\\dummy" # Not used in Windows, but attribute must be defined with a valid path
$forwarder_confdir = "${forwarder_homedir}\\etc"
Expand Down
4 changes: 2 additions & 2 deletions spec/classes/enterprise_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
it { is_expected.to contain_splunk_input('default_splunktcp').with(section: 'splunktcp://:9997', value: 'dns') }
it { is_expected.to contain_splunk_web('splunk_server_splunkd_port').with(value: '127.0.0.1:8089') }
it { is_expected.to contain_splunk_web('splunk_server_web_port').with(value: '8000') }
it { is_expected.not_to contain_file('/opt/splunk/etc/splunk.secret') }
it { is_expected.not_to contain_file('/opt/splunk/etc/auth/splunk.secret') }
it { is_expected.not_to contain_file('/opt/splunk/etc/passwd') }
end

Expand Down Expand Up @@ -121,7 +121,7 @@
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/auth/splunk.secret') }
it { is_expected.to contain_file('/opt/splunk/etc/passwd') }
end
end
Expand Down
6 changes: 3 additions & 3 deletions spec/classes/forwarder_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
it { is_expected.to contain_file('C:\\Program Files\\SplunkUniversalForwarder/etc/system/local/transforms.conf') }
it { is_expected.to contain_file('C:\\Program Files\\SplunkUniversalForwarder/etc/system/local/web.conf') }
it { is_expected.to contain_file('C:\\Program Files\\SplunkUniversalForwarder/etc/system/local/server.conf') }
it { is_expected.not_to contain_file('C:\\Program Files\\SplunkUniversalForwarder/etc/splunk.secret') }
it { is_expected.not_to contain_file('C:\\Program Files\\SplunkUniversalForwarder/etc/auth/splunk.secret') }
it { is_expected.not_to contain_file('C:\\Program Files\\SplunkUniversalForwarder/etc/passwd') }
else
it { is_expected.to contain_package('splunkforwarder').with(ensure: 'installed') }
Expand All @@ -46,7 +46,7 @@
it { is_expected.to contain_file('/opt/splunkforwarder/etc/system/local/transforms.conf') }
it { is_expected.to contain_file('/opt/splunkforwarder/etc/system/local/web.conf') }
it { is_expected.to contain_file('/opt/splunkforwarder/etc/system/local/server.conf') }
it { is_expected.not_to contain_file('/opt/splunkforwarder/etc/splunk.secret') }
it { is_expected.not_to contain_file('/opt/splunkforwarder/etc/auth/splunk.secret') }
it { is_expected.not_to contain_file('/opt/splunkforwarder/etc/passwd') }
end
it { is_expected.to compile.with_all_deps }
Expand All @@ -64,7 +64,7 @@
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/auth/splunk.secret') }
it { is_expected.to contain_file('/opt/splunkforwarder/etc/passwd') }
end
end
Expand Down

0 comments on commit b579524

Please sign in to comment.