Chris
2010-Jan-20 10:38 UTC
[Puppet Users] Is there a way to show the compiled config for a node?
Hi all, I''d like to be able to get at the compiled config for an arbitrary node (i.e. the content which is normally found in /var/puppet/state/ localconfig.yaml on the client), from the puppetmaster. Is there a way to do this? I''d find it useful for glueing together fact data (from the node/ *.yaml files) with the classes/resources that a particular client implements, to answer CMDB-ish queries (e.g. "What are the MAC addresses for all the mail servers?") Any ideas? ta -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Ohad Levy
2010-Jan-20 10:45 UTC
Re: [Puppet Users] Is there a way to show the compiled config for a node?
I''m assuming you are not using external nodes right? if you use storeconfigs, you will get all of that data in a db (classes, resources and facts). cheers, Ohad On Wed, Jan 20, 2010 at 6:38 PM, Chris <chrismay50@gmail.com> wrote:> Hi all, > > I''d like to be able to get at the compiled config for an arbitrary > node (i.e. the content which is normally found in /var/puppet/state/ > localconfig.yaml on the client), from the puppetmaster. Is there a way > to do this? > > I''d find it useful for glueing together fact data (from the node/ > *.yaml files) with the classes/resources that a particular client > implements, to answer CMDB-ish queries (e.g. "What are the MAC > addresses for all the mail servers?") > > Any ideas? > > ta > > > -- > 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+unsubscribe@googlegroups.com<puppet-users%2Bunsubscribe@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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Chris
2010-Jan-20 10:55 UTC
[Puppet Users] Re: Is there a way to show the compiled config for a node?
Thanks Ohad! Yes, I''d thought of that as a fallback. I am using storedconfigs, but pulling the data out of mysql is a (little) bit of a faff compared to doing YAML::load(file) - and I prefer writing ruby to writing SQL :-) Also I''m planning to switch to thin stored configs soon, which (as I understand it) means that only exported resources will appear in the DB, which would make this approach less useful. Chris On Jan 20, 10:45 am, Ohad Levy <ohadl...@gmail.com> wrote:> I''m assuming you are not using external nodes right? > > if you use storeconfigs, you will get all of that data in a db (classes, > resources and facts). > > cheers, > Ohad > > On Wed, Jan 20, 2010 at 6:38 PM, Chris <chrisma...@gmail.com> wrote: > > Hi all, > > > I''d like to be able to get at the compiled config for an arbitrary > > node (i.e. the content which is normally found in /var/puppet/state/ > > localconfig.yaml on the client), from the puppetmaster. Is there a way > > to do this? > > > I''d find it useful for glueing together fact data (from the node/ > > *.yaml files) with the classes/resources that a particular client > > implements, to answer CMDB-ish queries (e.g. "What are the MAC > > addresses for all the mail servers?") > > > Any ideas? > > > ta > > > -- > > 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+unsubscribe@googlegroups.com<puppet-users%2Bunsubscribe@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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Ohad Levy
2010-Jan-20 11:07 UTC
Re: [Puppet Users] Re: Is there a way to show the compiled config for a node?
Actually, Polling it from the db (using Ruby) is quite simple, and provide methods like give me all hosts in this class etc. How important the resources are to you? will you be considering moving to external nodes? that would in my opinion solve the problem. It would probably be possible to query foreman to get the results you need (something like http://theforeman.org/wiki/foreman/Query_Interface - which currently only give you back a list of host based on a puppet class / fact filtering). cheers, Ohad On Wed, Jan 20, 2010 at 6:55 PM, Chris <chrismay50@gmail.com> wrote:> Thanks Ohad! > > Yes, I''d thought of that as a fallback. I am using storedconfigs, but > pulling the data out of mysql is a (little) bit of a faff compared to > doing YAML::load(file) - and I prefer writing ruby to writing SQL :-) > > Also I''m planning to switch to thin stored configs soon, which (as I > understand it) means that only exported resources will appear in the > DB, which would make this approach less useful. > > Chris > > On Jan 20, 10:45 am, Ohad Levy <ohadl...@gmail.com> wrote: > > I''m assuming you are not using external nodes right? > > > > if you use storeconfigs, you will get all of that data in a db (classes, > > resources and facts). > > > > cheers, > > Ohad > > > > On Wed, Jan 20, 2010 at 6:38 PM, Chris <chrisma...@gmail.com> wrote: > > > Hi all, > > > > > I''d like to be able to get at the compiled config for an arbitrary > > > node (i.e. the content which is normally found in /var/puppet/state/ > > > localconfig.yaml on the client), from the puppetmaster. Is there a way > > > to do this? > > > > > I''d find it useful for glueing together fact data (from the node/ > > > *.yaml files) with the classes/resources that a particular client > > > implements, to answer CMDB-ish queries (e.g. "What are the MAC > > > addresses for all the mail servers?") > > > > > Any ideas? > > > > > ta > > > > > -- > > > 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+unsubscribe@googlegroups.com<puppet-users%2Bunsubscribe@googlegroups.com> > <puppet-users%2Bunsubscribe@googlegroups.com<puppet-users%252Bunsubscribe@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+unsubscribe@googlegroups.com<puppet-users%2Bunsubscribe@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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Chris
2010-Jan-20 11:31 UTC
[Puppet Users] Re: Is there a way to show the compiled config for a node?
On Jan 20, 11:07 am, Ohad Levy <ohadl...@gmail.com> wrote:> Actually, Polling it from the db (using Ruby) is quite simple, and provide > methods like give me all hosts in this class etc. >Yeah; I probably should just buckle down and learn how to use ActiveRecord, and avoid thin_storedconfigs. YAML just seemed like a quick-win if it was available.> How important the resources are to you?Hard to say. My suspicion is "not very", but I''m intending to use this for fairly arbitrary queries, so I guess it''s always possible that some question can only be answered by looking at the resource level rather than the class level. I can''t think of such a question at the moment though.> will you be considering moving to > external nodes? that would in my opinion solve the problem. >It''s not something I''ve thought about very much, largely because it introduces another dependency, which at this stage I''d prefer to avoid. I quite like the fact that at the moment if I want to see what''s changed on any server, I only need look in one place (my puppet config repo)! I guess if I were confident that I would only ever need top-level classes to answer my queries, then an external node DB would be sufficient, but if I needed resource-level information I don''t think it would work.> It would probably be possible to query foreman to get the results you need > (something likehttp://theforeman.org/wiki/foreman/Query_Interface- which > currently only give you back a list of host based on a puppet class / fact > filtering). >Hmm, that would be quite cool, but it''s another service to install and run (obviously, it gives more benefits than just a query interface!) It''s quite a bit of effort just to solve my immediate problem though. Thanks! Chris> Ohad > > On Wed, Jan 20, 2010 at 6:55 PM, Chris <chrisma...@gmail.com> wrote: > > Thanks Ohad! > > > Yes, I''d thought of that as a fallback. I am using storedconfigs, but > > pulling the data out of mysql is a (little) bit of a faff compared to > > doing YAML::load(file) - and I prefer writing ruby to writing SQL :-) > > > Also I''m planning to switch to thin stored configs soon, which (as I > > understand it) means that only exported resources will appear in the > > DB, which would make this approach less useful. > > > Chris > > > On Jan 20, 10:45 am, Ohad Levy <ohadl...@gmail.com> wrote: > > > I''m assuming you are not using external nodes right? > > > > if you use storeconfigs, you will get all of that data in a db (classes, > > > resources and facts). > > > > cheers, > > > Ohad > > > > On Wed, Jan 20, 2010 at 6:38 PM, Chris <chrisma...@gmail.com> wrote: > > > > Hi all, > > > > > I''d like to be able to get at the compiled config for an arbitrary > > > > node (i.e. the content which is normally found in /var/puppet/state/ > > > > localconfig.yaml on the client), from the puppetmaster. Is there a way > > > > to do this? > > > > > I''d find it useful for glueing together fact data (from the node/ > > > > *.yaml files) with the classes/resources that a particular client > > > > implements, to answer CMDB-ish queries (e.g. "What are the MAC > > > > addresses for all the mail servers?") > > > > > Any ideas? > > > > > ta > > > > > -- > > > > 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+unsubscribe@googlegroups.com<puppet-users%2Bunsubscribe@googlegroups.com> > > <puppet-users%2Bunsubscribe@googlegroups.com<puppet-users%252Bunsubscribe@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+unsubscribe@googlegroups.com<puppet-users%2Bunsubscribe@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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.