Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
    
Fixed what I believe was a typo. Correct? –  EEAA May 11 '12 at 15:06
    
Yes, many thanks. –  Tim Brigham May 11 '12 at 15:59
    
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

1 Answer 1

up vote 8 down vote accepted

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"]
}
share|improve this answer
    

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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