On Oct 27, 2008, at 11:29 AM, Ryan Steele wrote:
>
> It's been my understanding that the order in which resources are
> defined having no bearing on the order of execution. This would mean
> that the only way to ensure one resource is declared after or before
> another is with the use of certain metaparameters (e.g., before/
> require and notify/subscribe), which is straightforward enough.
> However, I'm not sure in what order statements are evaluated within a
> given resource. Take for example the documentation in the wiki entry
> on definitions in the LanguageTutorial (http://reductivelabs.com/trac/
> puppet/wiki/LanguageTutorial#definitions).
>
>
> In the second example, there is an 'if' statement that sets the
> 'require' attribute for the 'exec { "create_repo_${name}": ... }'
> resource. If the 'if' statement is evaluated second, the 'require'
> attribute will never be set, and the command might run without the
> assurance that the Subversion package was installed. So what
> determines whether or not that 'if' statement is evaluated and
> executed before the 'exec' resource is run? Does the Puppet
> interpreter realize that the 'if' statement provides information the
> 'exec' resource is potentially dependent on? Or does it simply
> evaluate non-resource statements first? If the latter is true (and
> this question is moot if the previous statement is incorrect), what
> happens if a non-resource statement depends on another non-resource
> statement; for example:
>
>
> if $foo { $baz = "quux" }
> $foo = "bar"
>
>
> I attempted to draw these conclusions by glossing through the
> PuppetInternals wiki page (http://reductivelabs.com/trac/puppet/wiki/
> PuppetInternals), but didn't really find what I was looking for
> (though it's certainly possible I overlooked that information). I
> appreciate any insight!
The entire set of manifests is evaluated on the server, producing a
catalog which is evaluated on the client. Thus, you never have to
worry about ordering between language constructs like 'if' and catalog
resources, because the language constructs are *always* evaluated
before any resources are evaluated.
--
It's not to control, but to protect the citizens of Singapore. In our
society, you can state your views, but they have to be correct.
-- Ernie Hai, co-ordinator of the Singapore Government
Internet Project
---------------------------------------------------------------------
Luke Kanies | http://reductivelabs.com | http://madstop.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Puppet Users" 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-users?hl=en
-~----------~----~----~----~------~----~------~--~---