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?
--
Craig White ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ craig...@ttiltd.com
1.800.869.6908 ~~~~~~~~~~~~~~~~~~~~~~~~~~~ www.ttiassessments.com
Need help communicating between generations at work to achieve your desired success? Let us help!
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,
Nan
----
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...@googlegroups.com.
To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
> 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.
Manifests are compiled to a catalog on the master. The catalog is then
sent to the client, which only applies what the master compiled. The
master can know about things of the client via facts.
So if you want to know if something is on the client you need to write a
custom fact for that.
But wait a moment before you do that. As puppet is your CM-Tool of
choice you would like to likely control things that are installed on the
clients via puppet. And somewhere at some point you define your puppet
client as an ldap server. As Nan suggested, this is the point where you
should also add the ldap-server itself as client. Not?
~pete
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAk4ycRsACgkQbwltcAfKi38zrwCePHUgFIOcnC1gJXhpJiWsLLGV
/zEAoI2203IoWWambb3++gevlmyj5amG
=UHs0
-----END PGP SIGNATURE-----
> 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)%
----
That worked perfectly (in the manifest which is precisely where I wanted it)...
if (tagged("ldap::server_install")) {
$ldap_servers = "ldap://127.0.0.1 ldap://ldap.ttinet"
} else {
...
first run too...
Thanks
Craig