2012/2/8 Felix Frank <felix.fr...@alumni.tu-berlin.de>: > Hi, > > On 02/08/2012 07:43 AM, jimbob palmer wrote: >> Now I will use includes as you suggest. Say I have a class that has an >> include, is there a guarantee that the include will always be included >> before the rest of the class is examined? > > Referencing variables scoped to included classes will *always* work. > > include foo > notify { "$foo::bar": } > > where $bar is declared in the class foo. > > Don't even thing about using $bar (without explicit scope $foo::bar) > anywhere outside the very foo class. > There are dynamic scoping features, but using them is stronly > discouraged (by me at least ;-) > >> I mean withint the same class. Say I have a case statement at the top >> of my class that sets a variable, will that run before I need the >> variable (later in the same class)? > > Yes, this most definitely works. > > I don't even think it's important in which order you use and declare > variables, because variables can be assigned only once. So there is no > concept of "earlier" or "later" where variables are concerned.
So say I have a single class which in order I need to ensure a file doesn't exist, then after that install a package, then after that call a define function. The file package part is doable with a chain (although I could be more confident about where they are defined), but how do I put the define function in the chain? > > HTH, > Felix > > -- > 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. > -- 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.