On Monday, October 8, 2012 12:26:41 PM UTC-5, Douglas wrote:
>
> I can't work this out and I'm getting frustrated. :( 
>
> Puppet is complaining: 
>
> err: Failed to apply catalog: Could not find dependency 
> Lvm::Volume_group[bcvg] for Lvm::Application_volume[cache] at 
> /truth/sauce/env/prod/modules/object_store/manifests/server.pp:47 
>
> Yet, if I comment out that line so that puppet runs ok, and then look 
> at the state.yml file on the client, I see: 
>
>   "Lvm::Volume_group[bcvg]": 
>     !ruby/sym checked: 2012-10-08 17:05:45.117364 +00:00 
>
> Now, according to the puppet docs at 
> http://docs.puppetlabs.com/puppet/2.7/reference/lang_scope.html, 
> resource titles are all global. 
>
> So.... what gives? By definition, this should not be occurring. 
>
>
Resource titles are global *once the associated resource declaration is 
parsed*.  It is up to you to ensure that declarations are parsed in an 
order that works.  That's not a big deal within one class, but it is 
potentially an issue when classes reference each others' declarations.

Far and away the best means I know to reliably get a suitable parse order 
is for each class and definition to 'include' any other classes whose 
resources or variables it references.  That is incompatible with 
parametrized-style declarations of those same classes anywhere else in your 
manifests, however, which is the biggest reason that I have no use for 
parametrized classes.  In Puppet 3 you can of course rely entirely on the 
new hiera binding for class parameters, and thereby use only 
'include'-style class declarations, but if you are committed to doing that 
then why parametrize your classes in the first place?

If you are stuck with parametrized classes then your only alternative is to 
be very careful and deliberate about where and in what order you declare 
each class.  Minimizing or centralizing interclass and especially 
intermodule dependencies will make that easier.


John

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/KWUjSlqLKiQJ.
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