6

I have a couple Splunk servers in house which I manage part of the configuration through puppet. These are residing on CentOS 6 boxes.

My definition is set up as

file{ "/opt/splunk/etc/apps":
  recurse => true,
  purge => true,
  force => true,
  source => "puppet:///modules/splunk/$hostname/apps",
  ensure =>  present,
  mode => 755,
  owner =>  splunk,
  group => splunk,
  notify => Service["splunk"]
}

This works well, but I'd like to exclude the saved searches file at /opt/splunk/etc/apps/myapp/local/savedsearches.conf from being overwritten and / or automatically update the copy contained within Puppet with the version kept on the local server.

Is there a ready way to do this? I looked over the documentation and didn't see anything.

  • Fixed what I believe was a typo. Correct? – EEAA May 11 '12 at 15:06
  • I figured it had to be a typo, but just wanted to make sure I didn't do something stupid. :) – EEAA May 11 '12 at 16:00
10

You can add ignore => "savedsearches.conf" to the file stanza to exclude it from operations on the managed directory.

file{ "/opt/splunk/etc/apps":
  recurse => true,
  purge => true,
  force => true,
  source => "puppet:///modules/splunk/$hostname/apps",
  ensure =>  present,
  mode => 755,
  owner =>  splunk,
  group => splunk,
  ignore => "savedsearches.conf"
  notify => Service["splunk"]
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.