Trevor Vaughan
2009-Nov-02 15:44 UTC
[Puppet Users] Looking for ideas on how to get details of managed resources on the puppet client.
All, I''m looking for a way to obtain information about the managed services on a given client system. Basically, some way to know what services have been enabled by Puppet from the client. I''m hoping to implement something like ''purge'' for services such that any service that is not defined is disabled and turned off. Any ideas on how to do this would be welcome. Thanks, Trevor --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Digant C Kasundra
2009-Nov-02 20:49 UTC
[Puppet Users] Re: Looking for ideas on how to get details of managed resources on the puppet client.
----- "Trevor Vaughan" <peiriannydd@gmail.com> wrote:> All, > > I''m looking for a way to obtain information about the managed > services > on a given client system. > > Basically, some way to know what services have been enabled by Puppet > from the client. > > I''m hoping to implement something like ''purge'' for services such that > any service that is not defined is disabled and turned off. > > Any ideas on how to do this would be welcome.If you want to know what services Puppet has managed on a client, you can look at the yaml file, or you can use store configs and poke at the DB. The problem with purging services is do you really want to define everything you know to expect on a server in Puppet? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Teyo Tyree
2009-Nov-03 02:33 UTC
[Puppet Users] Re: Looking for ideas on how to get details of managed resources on the puppet client.
On Mon, Nov 2, 2009 at 9:49 PM, Digant C Kasundra <digant@stanford.edu>wrote:> > > ----- "Trevor Vaughan" <peiriannydd@gmail.com> wrote: > > > All, > > > > I''m looking for a way to obtain information about the managed > > services > > on a given client system. > > > > Basically, some way to know what services have been enabled by Puppet > > from the client. > > > > I''m hoping to implement something like ''purge'' for services such that > > any service that is not defined is disabled and turned off. > > > > Any ideas on how to do this would be welcome. > > If you want to know what services Puppet has managed on a client, you can > look at the yaml file, or you can use store configs and poke at the DB. The > problem with purging services is do you really want to define everything you > know to expect on a server in Puppet? > >You can use the "resources" resource type to enable purging of all unmanaged resources of a given type. This only works for resources that are purgeable. The host resource type is a good example. The service resource type could possibly be extended to support this but at present it does not support purging. -teyo -- Teyo Tyree :: www.reductivelabs.com :: +1.615.275.5066 --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Trevor Vaughan
2009-Nov-04 12:38 UTC
[Puppet Users] Re: Looking for ideas on how to get details of managed resources on the puppet client.
Well, I ended up writing a script that pulls the information from the localconfig.yaml file and then stole bits from ralsh to see what services were on the system and turned off everything that shouldn''t be active. And yes, I do want to specify all services that should be running on the system. Interestingly, the following definition says that the service should exist, but to let it be whatever it is: service { "foo": } On this same note, how would I go about using the Puppet service provider in ruby code to turn off unwanted services? I just hand jammed it for now, but it would be nice to use the abstraction that is so nicely provided. Thanks, Trevor On Mon, Nov 2, 2009 at 15:49, Digant C Kasundra <digant@stanford.edu> wrote:> > > ----- "Trevor Vaughan" <peiriannydd@gmail.com> wrote: > >> All, >> >> I''m looking for a way to obtain information about the managed >> services >> on a given client system. >> >> Basically, some way to know what services have been enabled by Puppet >> from the client. >> >> I''m hoping to implement something like ''purge'' for services such that >> any service that is not defined is disabled and turned off. >> >> Any ideas on how to do this would be welcome. > > If you want to know what services Puppet has managed on a client, you can look at the yaml file, or you can use store configs and poke at the DB. The problem with purging services is do you really want to define everything you know to expect on a server in Puppet? > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
R.I.Pienaar
2009-Nov-04 12:41 UTC
[Puppet Users] Re: Looking for ideas on how to get details of managed resources on the puppet client.
hello, ----- "Trevor Vaughan" <peiriannydd@gmail.com> wrote:> On this same note, how would I go about using the Puppet service > provider in ruby code to turn off unwanted services? I just hand > jammed it for now, but it would be nice to use the abstraction that > is so nicely provided.see http://www.devco.net/archives/2009/10/19/reusing_puppet_providers.php -- R.I.Pienaar --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Trevor Vaughan
2009-Nov-04 13:02 UTC
[Puppet Users] Re: Looking for ideas on how to get details of managed resources on the puppet client.
Very cool! Much appreciated. Trevor On Wed, Nov 4, 2009 at 07:41, R.I.Pienaar <rip@devco.net> wrote:> > hello, > > ----- "Trevor Vaughan" <peiriannydd@gmail.com> wrote: > >> On this same note, how would I go about using the Puppet service >> provider in ruby code to turn off unwanted services? I just hand >> jammed it for now, but it would be nice to use the abstraction that >> is so nicely provided. > > see http://www.devco.net/archives/2009/10/19/reusing_puppet_providers.php > > -- > R.I.Pienaar > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Trevor Vaughan
2009-Nov-04 15:37 UTC
[Puppet Users] Re: Looking for ideas on how to get details of managed resources on the puppet client.
Just so you know, I couldn''t get the code to work as presented. I had to change the line: svc = Puppet::Type.type(:service).new(:name => service, :hasstatus => hasstatus).provider to: svc = Puppet::Type.type(:service).create(:name => service, :hasstatus => hasstatus).provider Then, it worked like a champ. Thanks, Trevor On Wed, Nov 4, 2009 at 07:41, R.I.Pienaar <rip@devco.net> wrote:> > hello, > > ----- "Trevor Vaughan" <peiriannydd@gmail.com> wrote: > >> On this same note, how would I go about using the Puppet service >> provider in ruby code to turn off unwanted services? I just hand >> jammed it for now, but it would be nice to use the abstraction that >> is so nicely provided. > > see http://www.devco.net/archives/2009/10/19/reusing_puppet_providers.php > > -- > R.I.Pienaar > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---