On Apr 10, 2010, at 6:02 PM, Ken wrote:
Would it be possible to do something like:
file { "/foo/voo/bar/baz" :
ensure => directory,
between => {
start => "/foo",
end => "/foo/voo/bar",
owner => "foo",
group => "foo",
mode => 755, }
between => {
start => "/foo/voo/bar/baz",
end => "/foo/voo/bar/baz",
owner => "baz",
group => "baz",
mode => 775, }
}
or would that require re-writing chuncks of puppet?
There was a patch to support hashes:
http://github.com/reductivelabs/puppet/commit/75c32f910ea124a938a7035b3352c11a11b57d0c
So you could in theory write your own provider. Up until that patch
the Puppet DSL would not have supported the format you suggest.
From another perspective. What's wrong with doing it this way:
file { ["/foo","/foo/voo","/foo/voo/bar" ]:
ensure => directory,
owner => "foo",
group => "foo",
mode => "0755"
}
file { "/foo/voo/bar/baz":
ensure => directory,
owner => "baz",
group => "baz",
mode => "0755"
}
Only the list seems a little wordy initially, but it won't take you
much longer to type then your suggestion.
And if your actual directory varies, it's pretty trivial to write a
function that expands a given file name into an array and does the
equivalent of this for any arbitrary directory.
--
The hypothalamus is one of the most important parts of the brain,
involved in many kinds of motivation, among other functions. The
hypothalamus controls the "Four F's": 1. fighting; 2. fleeing;
3. feeding; and 4. mating.
-- Psychology professor in neuropsychology intro course
---------------------------------------------------------------------
Luke Kanies -|- http://puppetlabs.com -|- +1(615)594-8199
--
You received this message because you are subscribed to the Google Groups "Puppet
Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-dev?hl=en.