Puppet:文件资源ignore通配规则未生效的问题求助
Fixing Puppet's Unintended Processing of
*..tra Files Hey Adam, let's work through why those ${name}..tra files are still being handled by Puppet and get this sorted:
Why Your Current Setup Isn't Working
Puppet's ignore parameter relies on standard glob pattern matching. Your existing rule ['*.tra'] matches files where any sequence of characters is followed directly by .tra—but ${name}..tra has two dots before the .tra extension, so this pattern doesn't catch it. That's why Puppet's still running checks like calculating checksums on those files.
The Fix: Adjust Your Ignore Pattern
Update the ignore array to include a pattern that specifically targets files ending with ..tra. Here's your revised file resource code:
file { "/opt/app/${name}/traces" : ensure => directory, owner => 'appuser', group => 'appuser', ignore => [ '*.tra', '*..tra' ], # Added pattern to match *..tra files backup => false, recurse => false }
Quick Extra Notes
- If you run into other similar edge cases (like files with more dots before
.tra), you could use a broader pattern like*.*.tra, but*..trais precise for your specific scenario. - Even with
recurse => false, Puppet scans directory contents to verify the directory's state. The updatedignorerule will tell Puppet to completely skip any files matching those patterns, so you'll stop seeing those strace/lsof hits for those files.
内容的提问来源于stack exchange,提问作者Adam C.
相关产品推荐
相关产品推荐

