On Mon, 18 Oct 2010 22:24:28 +0100
Bruce Richardson wrote:

Hi Bruce,

> > I'm wondering what puppet does if I define two diff type defaults
> > (like file mode, owner) in two different classes. I'm trying to
> > figure it out by running puppet and watching some file perms, but I
> > see no changes.
> 
> If you're seeing no changes, you aren't testing carefully enough.  See
> following example:

I've wrongly expressed myself. I was afraid of seeing some kind of
flip-flop on file perms.

> -----------------------------------------------------------------------
> 
> File {
>       ensure => 'file',
>       mode => '750'
> }
> 
> class test1 {
>       File { mode => '751' } 
>       file { '/tmp/test1': }
>       include test3
> }
> 
> class test2 {
>       file {'/tmp/test2': }
> }
> 
> class test3 {
>       file {'/tmp/test3': }
> }
> 
> file { '/tmp/toplevel': }
> 
> include test1
> include test2
> 
> -----------------------------------------------------------------------
> 
> In the above example, files test2 and toplevel have 750 permissions,
> test1 and test2 have 751.  Is this not what you find?  Should answer
          ^^^^^^^^
           test3 ?
> your questions.

I think it does: each class can have its own defaults. (which is my
desired behave).

My fear was that declaring File description in test1 could
change/overwrite general File description. In other words, 
 only one default possible.

> Resource defaults are inherited.  So be careful.
> 
> > 
> > We also have diff site.pp for diff porjects sharing main site.pp. Is
> > puppet evaluating site..p hiericaly?  Or all site.pp are evaluated
> > with same importance.
> 
> You're going to have to explain that in a little more detail.  It's
> not clear how you have this organised. 
ok. le me use site#.pp for future references:
My tree:

~puppet/manifests/site1.pp 
                /services/
                         /SERA/site2.pp
                              /modules2
                         /SERB/site3.pp
                              /modules3

-site1.pp defines some defaults and includes services/SERA/site2.pp and
service/SERB/site3.pp
-site2.pp defines its own defaults for modules2
-site3.pp defines its own defaults for modules3

are defaults respected? If site1 defines mode 777, site2 defines mode
750 and site3 mode 644, what is the default? 

*My tests show that a file in module2 has perms 750, one in module3 has
perms 644, which is desired. but we're seeing some rare situacion where
some files have rare perms, and we're wondering if this schema is
producing problems or not.


Many thanks for your reply,
Arnau

-- 
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.

Reply via email to