Le vendredi 5 juillet 2013 17:43:47 UTC+2, David Schmitt a écrit :

> 2) I would like to have $var == "YES" whatever the order of classes in 
> > the yaml file. Is it possible ? 
>
> tagged() (and all other functions) are parse-order dependent. The stage 
> definition only establishes an application order. 


Ok, thank you for the distinction between "parse-order" and "application 
order", I keep that in mnd. In these conditions, I think the "tagged()" 
function loosing interest.

 

> The recommended way 
> forward is to express the configuration dependency explicitly like so: 
>
>    class meta($one = true) { 
>      if $one {
>        include one 
>      }  
> or to directly integrate this into the class two. This depends on your 
> actual use case. 
>

Sorry, but I tried to understand your example but I didn't. Do I have to 
put the "meta" class in the yaml file of my host? If yes, I don't see why 
it solves the problem. Sorry. I'm a puppet beginner.

In fact, I'll explain the purpose of my post. I have choose a simplied 
example.
I have a class named "monitoring" (but in my example it's the "two" class) 
in which I want to define some variables according to some other classes 
are used or not by the host. I show you :

class monitoring {

   # if the host uses the http class $http = "http" else $http = "NONE"

   # if the host uses the mysql class $mysql = "mysql" else $mysql = "NONE"

   # etc.
}

I thought tagged() function will make the job but, as you explain me, it's 
order-dependent. I'll try to think about your example...


--
François Lafont

-- 
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 post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to