From f7034862a590547c03899fffcabe391ef92ae517 Mon Sep 17 00:00:00 2001 From: Jorrit Folmer Date: Fri, 8 Jan 2016 15:54:49 +0100 Subject: [PATCH] Added version parameter --- README.md | 12 +++++++++++- manifests/init.pp | 9 +++++---- manifests/installed.pp | 16 ++++++++++++---- manifests/params.pp | 3 ++- 4 files changed, 30 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 859c032..95d44e1 100644 --- a/README.md +++ b/README.md @@ -309,6 +309,7 @@ node 'splunk-cidx1.internal.corp.tld', name and email This is a hash with 3 members: - `hash` (SHA512 hash of the admin password) + - `pass` (Plaintext password, only used for search heads to add search peers in distributed search) - `fn` (Full name) - `email` (Email address) @@ -344,6 +345,11 @@ node 'splunk-cidx1.internal.corp.tld', This is useful if you want to retain one central deployment server instead of multiple, for example one for each DMZ. Defaults to undef. +#### `version` + + Optional. Specify the SPlunk version to use. + For example to install the 6.2.2 version: `verion => '6.2.2-255606'`. + ## Compatibility Requires Splunk and Splunkforwarders >= 6.2.0. @@ -353,6 +359,11 @@ If you have version >= 6.2.0 servers but with stock settings from a previous Spl ## Changelog +### 1.0.4 + +- Optionally specify Splunk version to install +- Merged PR #1 from @timidri + ### 1.0.3 - Added `ds_intermediate` parameter to create a deployment server that can deploy apps from an another upstream deployment server. @@ -386,7 +397,6 @@ Initial release: ## Roadmap -- Optionally specify Splunk version to install - Search head clustering: search head - Search head clustering: deployer - Distributed Management Console diff --git a/manifests/init.pp b/manifests/init.pp index 36cc8d2..83e7bb2 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -73,15 +73,16 @@ $dhparamsize_intermediate = $splunk::params::dhparamsize_intermediate, $ecdhcurvename_intermediate = $splunk::params::ecdhcurvename_intermediate, $inputport = $splunk::params::inputport, - $httpport = $splunk::params::httpport, - $kvstoreport = $splunk::params::kvstoreport, + $httpport = $splunk::params::httpport, + $kvstoreport = $splunk::params::kvstoreport, $tcpout = $splunk::params::tcpout, - $searchpeers = $splunk::params::searchpeers, - $admin = $splunk::params::admin, + $searchpeers = $splunk::params::searchpeers, + $admin = $splunk::params::admin, $clustering = $splunk::params::clustering, $service = $splunk::params::service, $useACK = $splunk::params::useACK, $ds_intermediate = $splunk::params::ds_intemediate, + $version = $splunk::params::version, ) inherits splunk::params { if $type == 'uf' { diff --git a/manifests/installed.pp b/manifests/installed.pp index ba0515c..a4aa517 100644 --- a/manifests/installed.pp +++ b/manifests/installed.pp @@ -2,10 +2,17 @@ class splunk::installed ( $package = $splunk::package, $splunk_home = $splunk::splunk_home, - $splunk_os_user = $splunk::splunk_os_user + $splunk_os_user = $splunk::splunk_os_user, + $version = $splunk::version ) { - package { $package: - ensure => installed, + if $version == undef { + package { $package: + ensure => installed, + } + } else { + package { $package: + ensure => "${version}", + } } exec { 'splunk enable boot-start etcetera': command => "${splunk_home}/bin/splunk enable boot-start -user ${splunk_os_user} --accept-license --answer-yes --no-prompt", @@ -13,5 +20,6 @@ require => Package[$package], creates => "${splunk_home}/etc/system/local/server.conf", } -} +} + diff --git a/manifests/params.pp b/manifests/params.pp index 9af7a90..a8c570e 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -26,7 +26,8 @@ enable => true, ensure => undef, } - $useACK = false + $useACK = false $ds_intermediate = undef + $version = undef }