2009/6/23 David Bishop <[email protected]>

>
> roles/webserver.pp:
>
> class webserver {
>        $webserver = true
> }
>
> templates/repo.erb:
>
> The value of the variable is <%= $webserver::webserver %>.
>
>
> I also tried $::webserver (after moving it out of the class definition),
> $webserver, setting a tag in the class and then reading out the defined
> tags, and more.  But that should give you guys an idea of what I'm
> aiming to do.
>
> Thanks for any pointers!
>
>

So there is actually a notion of tags in puppet, I don't know if you've
looked at it but there is a wiki page on it:

http://reductivelabs.com/trac/puppet/wiki/UsingTags

It should be noted that classes come with their own tags, so doing an
"include webserver" will give you the tag webserver, so in your yum class
you could just do:

if tagged(webserver) {
  ....
}

.r'

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to