On Friday, January 16, 2015 at 12:48:19 PM UTC-6, Weeve wrote:
>
> On Thu, Jan 15, 2015 at 9:53 AM, jcbollinger <[email protected] 
> <javascript:>> wrote: 
> > 
> > In any case, if $foo does not resolve to a class or resource reference, 
> then 
> > why does catalog building succeed?  (Or perhaps the problem actually 
> > manifests as catalog building failure....) 
>
> Feels like I've been staring at the problem too long, forgetting to 
> provide a little more detail here. 
>
> When I have requires = $foo, the catalog does compile and $foo does 
> resolve to Class['a'] or Class['b'] correctly when I look at the debug 
> output from the Puppet agent (puppet agent -tv --debug). 
>
> If I use the anchor method as well ($foo -> Class['a]), it wasn't 
> installing it in the preferred order as well, but if I use the anchor 
> method on the Service Type that Class['a'] provides in its service.pp, 
> then it worked for me. 
>


There seems to be a bit of a terminology gap here.  Class['a'] does not 
"have" a service.pp in any useful sense of the term.  I suppose you 
probably mean that *module* 'a' has a class or defined type "a::service" 
whose definition resides in modules/a/manifests/service.pp.  The 
distinction matters, as does, in particular, whether a::service is a class 
or a defined type.  (In a typical module architecture, such a thing would 
be a class.)

Moreover, it's unclear what you mean when you say you "use the anchor 
method on the Service Type [...]."  I can probably guess roughly what you 
mean, but here, too, the details matter.  We can give better answers if you 
present code that actually exhibits the problem -- preferrably *minimal* 
code that does so.

 

>
> >> This should work: 
> >> 
> >> $foo = "a" 
> >> 
> >> File["/path/to/file"] { require => Class[$foo] } 
> >> 
>
> This method allowed the catalog to compile as well, but didn't change 
> any of the ordering issues. 
>
>

My best guess at this point is that you have a class containment issue 
<https://docs.puppetlabs.com/puppet/latest/reference/lang_containment.html#containing-classes>.
  
That is, Puppet is very likely applying the ordering you specify, but that 
doesn't have the *effect* you expect because Class['a'] and/or Class['b'] 
declares other classes that you consider as belonging to 'a' / 'b', but 
which are not properly contained by 'a' / 'b'.


John

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/e7828d3c-70f2-4b02-a919-1846d0b8dc42%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to