Does any one have a recipe for getting facter facts from ldap?
Brian Finney wrote:> Does any one have a recipe for getting facter facts from ldap?Do you mean getting facter "plugins" to gather facts about the machine, or just looking up attributes in LDAP and setting facts to those attribute values? I''m a bit confused why you''d want the latter, as facts are intended to be information about each machine puppet is running on. What''s your use case? Cheers, -- Jeff McCune Systems Manager The Ohio State University Department of Mathematics _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
I''m working on hooking puppet into ldap, however some of my host configurations are host specific (i.e. ip addresses, mysql server-id, ...). As far as I have been able to tell so far, the ldap integration is designed to simply apply a class to a machine and allow for inheritance. Thus inorder for me to configure these host specific values I would have to have a unique class per machine to define their values, which to me defeats the purpose of moving to ldap. I was hoping to be able to put these configuration variables in ldap under each machine and then be able to access them in generic classes. I assumed the best way to do this would be for facter to connect to ldap and pull the config variables out as facts. Does this make sense? Is there a better way I''m overlooking? Thanks Brian On 6/13/07, Jeff McCune <mccune@math.ohio-state.edu> wrote:> Brian Finney wrote: > > Does any one have a recipe for getting facter facts from ldap? > > Do you mean getting facter "plugins" to gather facts about the machine, > or just looking up attributes in LDAP and setting facts to those > attribute values? > > I''m a bit confused why you''d want the latter, as facts are intended to > be information about each machine puppet is running on. What''s your use > case? > > Cheers, > -- > Jeff McCune > Systems Manager > The Ohio State University > Department of Mathematics > > _______________________________________________ > Puppet-users mailing list > Puppet-users@madstop.com > https://mail.madstop.com/mailman/listinfo/puppet-users > > >
On Wed, Jun 13, 2007 at 11:42:18AM -0700, Brian Finney wrote:> I was hoping to be able to put these configuration variables in ldap > under each machine and then be able to access them in generic classes. > > I assumed the best way to do this would be for facter to connect to > ldap and pull the config variables out as facts. > > Does this make sense? Is there a better way I''m overlooking?I don''t know if there is a better way, but it would be a pretty simple facter script to write. The only issue you''re liable to run into is how to store the values within the LDAP object itself, and the fact that facter doesn''t support arrays (while LDAP attributes can be multi-valued.) Additionally, you''ll need to create either custom attributes (and a corresponding custom object class) or a single custom attribute (and object class) that thickly stores a facter pair: facterfact: fact => one facterfact: fact => two etc. Adam -- HJK Solutions - We Launch Startups - http://www.hjksolutions.com Adam Jacob, Senior Partner T: (206) 508-4759 E: adam@hjksolutions.com
> I don''t know if there is a better way, but it would be a pretty simple > facter script to write. The only issue you''re liable to run into is how > to store the values within the LDAP object itself, and the fact that facter > doesn''t support arrays (while LDAP attributes can be multi-valued.) Additionally, you''ll need to create either custom attributes (and a corresponding custom object class) or a single custom attribute (and object class) that thickly stores a facter pair: > > facterfact: fact => one > facterfact: fact => two >Facter runs on the node, so the node would have to connect to your LDAP server in order to obtain the information to present. If you''re actually talking about storing information in a local LDAP server on each node, then you just removed any benefit of having a centralised DB. Given that you can store a set of classes to apply to a node within ldap, I think it would make far more sense to allow setting puppet variables instead. The end result will be the same, more or less - you access the variables via $variablename inside your class definitions, but that''s slightly different from involving facter in any way. Two cavaets: I haven''t looked at the code for LDAP node defs to see if this is even remotely likely to be a possible thing to do; and from what I''ve seen, kinial should solve all this anyway.
On Jun 13, 2007, at 8:35 PM, Daniel Lawson wrote:> Given that you can store a set of classes to apply to a node within > ldap, I think it would make far more sense to allow setting puppet > variables instead. The end result will be the same, more or less - you > access the variables via $variablename inside your class definitions, > but that''s slightly different from involving facter in any way. > > Two cavaets: I haven''t looked at the code for LDAP node defs to see if > this is even remotely likely to be a possible thing to do; and from > what > I''ve seen, kinial should solve all this anyway.It''s been driving me batty how much people are looking for this kind of functionality, so I decided to implement it (see my ANNOUNCE email). Please, please, please test it, make sure it behaves like you expect. Also, please write up a document on the wiki for it. :) -- Nonreciprocal Laws of Expectations: Negative expectations yield negative results. Positive expectations yield negative results. --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
I haven''t even gotten around to testing the MySQL stuff yet, haha. I have a few work related things to finish up and then I can work on updating puppet to your trunk and see how things work out. Thanks for the new features to play with. Brian On 6/14/07, Luke Kanies <luke@madstop.com> wrote:> On Jun 13, 2007, at 8:35 PM, Daniel Lawson wrote: > > > Given that you can store a set of classes to apply to a node within > > ldap, I think it would make far more sense to allow setting puppet > > variables instead. The end result will be the same, more or less - you > > access the variables via $variablename inside your class definitions, > > but that''s slightly different from involving facter in any way. > > > > Two cavaets: I haven''t looked at the code for LDAP node defs to see if > > this is even remotely likely to be a possible thing to do; and from > > what > > I''ve seen, kinial should solve all this anyway. > > It''s been driving me batty how much people are looking for this kind > of functionality, so I decided to implement it (see my ANNOUNCE email). > > Please, please, please test it, make sure it behaves like you expect. > > Also, please write up a document on the wiki for it. :) > > -- > Nonreciprocal Laws of Expectations: > Negative expectations yield negative results. Positive expectations > yield negative results. > --------------------------------------------------------------------- > Luke Kanies | http://reductivelabs.com | http://madstop.com > > > _______________________________________________ > Puppet-users mailing list > Puppet-users@madstop.com > https://mail.madstop.com/mailman/listinfo/puppet-users >