On Saturday, May 28, 2016 at 6:19:19 PM UTC-5, Dan Mahoney wrote:
>
> Hey there. 
>
> This is a weird question, but I guess I'll ask it anyway. 
>
> Is there a way to say one of the following two things? 
>
> 1) That you want a manifest to deliberately break when you try to include 
> two different items?



Rob already mentioned using the defined() function to test whether a key 
class of the competing module has already been declared.  Do note (lack of) 
capitalization.  More importantly, be aware that for this strategy to work, 
it needs to be mutual -- each module needs to exclude the other.  If it 
were not mutual, then it would be possible to declare both modules in the 
same catalog despite the test, as long the declarations were evaluated in 
the correct order.

Another alternative would be to choose some specific resource that has no 
corresponding physical resource, and have both modules declare that 
resource.  If both modules are included then catalog building will fail 
with a duplicate declaration error.  That, too, needs to be mutual, of 
course.  I like this alternative better because it seems a better match to 
Puppet's resource-centric model.


2) To say that if I've installed the "postfix" module, that it basically 
> de-includes the "dma" class from the manifest? 
>
>

No.  During catalog building, including a class or resource in the catalog 
is irreversible.  This is a good reason to implement ideas such as yours to 
abstract MTA management to one class that chooses which system to use based 
on data.  I like the kind of mutual exclusion you asked about better as a 
backstop for such an approach than as a primary mechanism.


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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/dd04da57-621c-4228-a3f5-3eff25e545f0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to