On 3/31/10 5:37 PM, Terra wrote:
Greetings,
I'm having a bit of a problem where file{} doesn't support globbing...
Say I have the following directory tree:
/foo (mode: 0751)
/foo/bar1
/foo/baz1
/foo/random1
...
/foo/randomN
All subdirectories under '/foo' can be arbitrary names...
How I would like to be able to express this, which won't work...
file { "/foo/*": mode => 700; }
What comes close is:
file { "/foo": mode => 700, recurse => "true", recurselimit => 1; }
The problem with that, is '/foo' is also set to mode 700, when it
should remain mode 751...
What is the proper way to express the above in Puppet, in the absence
of globbing capabilities, when I want to make changes _only_ to the
files and/or directories contained _within_ the specified directory
while leaving the specified directory alone?
I feel like I'm missing something really obvious... :(
You can use an exec and call chmod or find depending on whether you want
a hard recurselimit or not:
exec { "find /foo -exec chmod 700 {} \;": }
or
exec { "find /foo -maxdepth 1 -exec chmod 700 {} \;": }
Brian
Thanks!
--
Terra
--
You received this message because you are subscribed to the Google Groups "Puppet
Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.