It looks like you're wanting to do it via erb, but if you can perform
whatever logic in the manifest, you can use tagged:

(scott@cornstarch:tmp)% cat foo.pp
class foo { }

class bar {
  if (tagged("foo")) {
    notice("You're including foo")
  }
}

include foo, bar
(scott@cornstarch:tmp)% puppet foo.pp
notice: Scope(Class[Bar]): You're including foo
notice: Finished catalog run in 0.01 seconds
(scott@cornstarch:tmp)%

-scott

On Thu, Jul 28, 2011 at 12:42 PM, Craig White <craig.wh...@ttiltd.com>wrote:

>
> On Jul 28, 2011, at 11:39 AM, Nan Liu wrote:
>
> > On Thu, Jul 28, 2011 at 1:48 PM, Craig White <craig.wh...@ttiltd.com>
> wrote:
> >> Trying to ascertain if a particular client has been assigned the class
> ldap::server_install because I want to have a different configuration value
> for the ldap::configure files
> >>
> >> This just gives me a syntax error...
> >>
> >>  Class["ldap::server_install"].included? ? $is_ldap_server = true :
> $is_ldap_server = false
> >>
> >> Is there a way that I can derive whether a class has been assigned to
> the client or do I have to write a custom fact?
> >
> > Presumably, you have already made a decision somewhere in you manifest
> > to include class ldap::server_install, so why not set a variable
> > there? I assume you want the correct config in one run, rather than
> > waiting for ldap to be deployed before a custom fact updates.
> >
> > Thanks,
> ----
> actually, it's likely to be already deployed (ldap::client_install &
> ldap::configure) as those are somewhat of a base functionality. My intent is
> to ensure that if the client is actually an LDAP server, that it attempts to
> connect to itself first, rather than another server over the wire.
>
> So yes, it would be better to get it right on the first run but given an
> array of available ldap servers to connect to, it's possible that a manually
> typed and erroneous variable could go unnoticed. Also, this seems to be
> something that is knowable anyway and probably not too difficult to write a
> custom fact that perhaps will take 2 puppet runs to fix.
>
> It just seemed to me that there must be some way to derive what is
> installed on the client within a manifest but I couldn't find any
> suggestions on Google or PuppetLabs site so I asked.
>
> Thanks
>
> Craig
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To post to this group, send email to puppet-users@googlegroups.com.
> To unsubscribe from this group, send email to
> puppet-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to