Hi all,

I have a couple of "basic" questions on classes.

In a class, what's the diff between:

*don't take in count syntax, please.

----------------------------------
class class_B {
        package { fortune }
        file { dummy }
        }
----------------------------------

example 1)

class class_A {
        import class_B
        package { foo }


example 2)

class class_A {
        file { bogus 
                before = > Package [foo],
                }
        package { foo
                require  => Class["class_B"],
                }
        }

example 3)

class class_A inherits class_B {
        package { foo }

In first example class_B will be evaluated before ALL class_A. 
so package fortuen and dummy file will be installed/created before
package foo. 

In second one, class_B will be evaluted ONLY when package
foo. So, first bogus package, then, before foo, fortune and summy file.


And on third example? same as first one?


I don't see difference between example 1 and 3.

All comes from some examples from David Schmitt:
http://git.black.co.at/?p=module-ssh;a=blob;f=manifests/init.pp;h=9c87f5956b9c10a5fa422044a43ba38b27a4b96f;hb=9ccdd6ed46031db9001f9b71285455c297f56dfc

   5 class ssh::common {
   6         file {
   7                 "/etc/ssh":
   8                         ensure => directory,
   9                         mode => 0755, owner => root, group => root,
  10         }
  11         group {
  12                 ssh:
  13                         gid => 204,
  14                         allowdupe => false,
  15         }
  16 }
  17 
  18 class ssh::client inherits ssh::common {
  19         package {
  20                 "openssh-client":
  21                         ensure => installed,
  22                         require => [ File["/etc/ssh"], Group[ssh] ],
  23         }
[...]

Why is he requering File and Group if class ssh::client inherits
ssh:common?


Oh, if I include class_B in class_A, node def should be enough with:

node "node.bogus.com" {
        include class_A
        }

right?


TIA,
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-users@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