Skip to content

Commit 6b6e981

Browse files
authored
Merge pull request #199 from Joshua-Snapp/improve_ftr_license_agreement
Improve ftr license agreement
2 parents 3fbbeea + 47bc08c commit 6b6e981

File tree

2 files changed

+38
-2
lines changed

2 files changed

+38
-2
lines changed

README.md

+35
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
* [Setup requirements](#setup-requirements)
1717
* [Beginning with splunk](#beginning-with-splunk)
1818
1. [Usage - Configuration options and additional functionality](#usage)
19+
* [Upgrade splunk/splunkforwarder packages](#upgrade-splunksplunkforwarder-packages)
20+
* [Upgrade Example](#upgrade-example)
1921
1. [Reference - An under-the-hood peek at what the module is doing and how](#reference)
2022
1. [Limitations - OS compatibility, etc.](#limitations)
2123
1. [Development - Guide for contributing to the module](#development)
@@ -161,6 +163,39 @@ This virtual resource will get collected by the `::splunk::forwarder` class if
161163
it is tagged with `splunk_forwarder` and will add the appropriate setting to
162164
the inputs.conf file and refresh the service.
163165

166+
### Upgrade splunk/splunkforwarder packages
167+
168+
This module has the ability to install *and* upgrade the splunk and splunkforwarder packages. All you have to do is declare `package_ensure => 'latest'` when calling the `::splunk` or `::splunk::forwarder` classes.
169+
170+
#### Upgrade Example
171+
172+
The following code will install the 6.6.8 version of the splunk forwarder. Then
173+
comment out the 6.6.8 version and build values and uncomment the 7.1.2 version
174+
and build values. Running puppet again will perform the following:
175+
176+
1. splunk forwarder package is upgraded
177+
1. splunk service is stopped as part of the package upgrade process
178+
1. new license agreement is automatically accepted
179+
1. license agreement must be accepted or the splunk service will fail to start
180+
1. splunk service is started
181+
182+
```puppet
183+
# Tell the module to get packages directly from Splunk.
184+
class { '::splunk::params':
185+
version => '6.6.8',
186+
build => '6c27a8439c1e',
187+
#version => '7.1.2',
188+
#build => 'a0c72a66db66',
189+
src_root => 'https://download.splunk.com',
190+
}
191+
192+
# Specifying package_ensure => 'latest' will ensure that the splunk and
193+
# splunkforwarder packages will be upgraded when you specify newer values for
194+
# version and build.
195+
class { '::splunk::forwarder':
196+
package_ensure => 'latest',
197+
}
198+
```
164199
## Reference
165200

166201
### Types

manifests/platform/posix.pp

+3-2
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,12 @@
2727
# Commands to run to enable the SplunkUniversalForwarder
2828
@exec { 'license_splunkforwarder':
2929
path => "${splunk::params::forwarder_dir}/bin",
30-
command => 'splunk start --accept-license --answer-yes --no-prompt',
30+
command => 'splunk ftr --accept-license --answer-yes --no-prompt',
3131
user => $splunk_user,
32-
creates => '/opt/splunkforwarder/etc/auth/server.pem',
32+
onlyif => "/usr/bin/test -f ${splunk::params::forwarder_dir}/ftr",
3333
timeout => 0,
3434
tag => 'splunk_forwarder',
35+
notify => Service['splunk'],
3536
}
3637
@exec { 'enable_splunkforwarder':
3738

0 commit comments

Comments
 (0)