Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to use the File type resource to leverage ignoring a hidden directory

Currently we have an NFS mount that our StatsD/Graphite data is written to. This NFS volume has SnapShots enabled and therefore a .snapshot folder exists. The .snapshot director is owned by root:root. Currently, all other files and folders in that same level need to be set to www-data:www-data.

The problem I'm running into is that when I'm attempting to use the File type resource and include the ignore parameter, it does not appear to be working properly. I've also tried to escape the '.' without any success.

I also looked at the Puppet source code for some direction, but wasn't able to make any progress

Code:

file { '/opt/graphite/storage':
  owner   => $::graphite::params::web_user,
  group   => $::graphite::params::web_user,
  ignore  => '.snapshot',
  recurse => true,
  require => Anchor['graphite::install::end'],
}

Output:

debug: Executing '/usr/bin/test -e /data/apps/talkbox/shared/log/nitrometrics.log'
debug: file_metadata supports formats: b64_zlib_yaml pson raw yaml; using pson
debug: /Schedule[puppet]: Skipping device resources because running on a host
notice: /File[/data/opt/graphite/storage/.snapshot]/owner: current_value root, should be www-data (noop)
notice: /File[/data/opt/graphite/storage/.snapshot]/group: current_value root, should be www-data (noop)
debug: /File[/data/opt/graphite/storage/.snapshot]: The container /data/opt/graphite/storage will propagate     my refresh event
debug: /File[/data/opt/graphite/storage/.snapshot]: The container /data/opt/graphite/storage will propagate my refresh event
notice: /File[/data/opt/graphite/storage/.snapshot/hourly.3/carbon-cache-a.pid]/owner: current_value root, should be www-data (noop)
notice: /File[/data/opt/graphite/storage/.snapshot/hourly.3/carbon-cache-a.pid]/group: current_value root, should be www-data (noop)