All,
I am using puppet 3.1.1 and I need to know if a class has been defined. I
have tried defined() and tagged(), but neither seem to work. They either
return true when the class was not include for that node or false when it
is included.
Here is the use case:
My admin users are defined (virtual) in a class and I need to add them to
groups for different nodes. As groups cant be have their members managed,
but rather user have their membership managed. For example the mysql group
for database servers and httpd for web servers.
#in the service class there is a tag(''mysql-serve')
if tagged('mysql-server') {
$groups = [ 'wheel', $mysql::params::group ]
} else {
$groups = ['wheel' ]
}
#My understand is NOT to use Class['mysql::service']
if defined('mysql::service') {
$groups = [ 'wheel', $mysql::params::group ]
} else {
$groups = ['wheel' ]
}
Thanks!
--
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 post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.