Custom SplunkForwarder module
OK so I have a module that I have written myself to deploy the splunkforwarder module on a CentOS/RHEL system. I only started to pick Puppet up as a tool a few weeks ago and so I am by all means a novice.
The module install's the splunkforwarder rpm file from a local repo (already handled prior). The
ensure parameter is set to
latest so as you'd expect each time puppet runs on the agent node it will upgrade the previous version of the splunkforwarder if a later rpm is present in the repo. The first installation is going OK. However, the module faults when upgrading. My problem is that I don't know how to program the relationships between which stanzas. Specifically, before upgrading I want to execute a command to:
- check that there is a previous installation
- if there's a currently running splunk service, then stop it.
- upgrade the software, then go through the usual
splunk start --accept-license --answer-yesand
splunk enable boot-startafter applying my own
output.conffile from the puppet master.
I am aware that there is already a module over at the forge, but I'd like to write my own for my own local purposes.