John Warburton
2010-Sep-17 11:32 UTC
[Puppet Users] Can I access data structure internal to providers
Hi I would like to be able to access the hash "info2hash" in lib/puppet/provider/package/sun.rb which is a list of all Solaris packages on a Sun server Is it possible to query this so that I don''t have to run "pkginfo -l" myself, and probably create a fact for each package with its version number? My Ruby is basic, so I''m not quite sure how to read providers. What I am trying to do is have my own Solaris package provider that is versionable without having to resort to supporting Blastwave/Sunfreeware like external scripts. The last comment for the "update" definition doesn''t make me comfortable "This will probably often fail" Thanks John -- 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.
Nigel Kersten
2010-Sep-17 15:41 UTC
Re: [Puppet Users] Can I access data structure internal to providers
On Fri, Sep 17, 2010 at 4:32 AM, John Warburton <jwarburton@gmail.com> wrote:> Hi > > I would like to be able to access the hash "info2hash" in > lib/puppet/provider/package/sun.rb which is a list of all Solaris packages > on a Sun server > > Is it possible to query this so that I don''t have to run "pkginfo -l" > myself, and probably create a fact for each package with its version number? > My Ruby is basic, so I''m not quite sure how to read providers. > > What I am trying to do is have my own Solaris package provider that is > versionable without having to resort to supporting Blastwave/Sunfreeware > like external scripts. The last comment for the "update" definition doesn''t > make me comfortable "This will probably often fail"It sounds like you want to subclass the provider yourself so you get that hash/method for free.> > Thanks > > John > > -- > 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. >-- 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.
John Warburton
2010-Sep-19 12:41 UTC
Re: [Puppet Users] Can I access data structure internal to providers
Hi Nigel On 18 September 2010 01:41, Nigel Kersten <nigel@explanatorygap.net> wrote:> On Fri, Sep 17, 2010 at 4:32 AM, John Warburton <jwarburton@gmail.com> > wrote: > > Hi > > > > I would like to be able to access the hash "info2hash" in > > lib/puppet/provider/package/sun.rb which is a list of all Solaris > packages > > on a Sun server > > > > It sounds like you want to subclass the provider yourself so you get > that hash/method for free. > > I''m not really sure what that means, which might be my original problem.Does this mean editing/changing sun.rb or creating my own mysun.rb and somehow inherit sun.rb and all its goodies? Do you have any pointers where I can up to speed with this sort of thing? Thanks John -- 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.
Nigel Kersten
2010-Sep-19 15:21 UTC
Re: [Puppet Users] Can I access data structure internal to providers
On Sun, Sep 19, 2010 at 5:41 AM, John Warburton <jwarburton@gmail.com> wrote:> Hi Nigel > > On 18 September 2010 01:41, Nigel Kersten <nigel@explanatorygap.net> wrote: >> >> On Fri, Sep 17, 2010 at 4:32 AM, John Warburton <jwarburton@gmail.com> >> wrote: >> > Hi >> > >> > I would like to be able to access the hash "info2hash" in >> > lib/puppet/provider/package/sun.rb which is a list of all Solaris >> > packages >> > on a Sun server >> > >> >> It sounds like you want to subclass the provider yourself so you get >> that hash/method for free. >> > I''m not really sure what that means, which might be my original problem. > Does this mean editing/changing sun.rb or creating my own mysun.rb and > somehow inherit sun.rb and all its goodies? > > Do you have any pointers where I can up to speed with this sort of thing?I mean the latter, inheritance. I would probably have a look at the apt* providers and how they inherit from the dpkg provider?> > Thanks > > John > > -- > 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. >-- 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.
John Warburton
2010-Sep-20 12:40 UTC
Re: [Puppet Users] Can I access data structure internal to providers
Thanks Nigel I''m slowly digesting this whilst quickly learning my next step of ruby John On 20 September 2010 01:21, Nigel Kersten <nigel@explanatorygap.net> wrote:> On Sun, Sep 19, 2010 at 5:41 AM, John Warburton <jwarburton@gmail.com> > wrote: > > Hi Nigel > > > > On 18 September 2010 01:41, Nigel Kersten <nigel@explanatorygap.net> > wrote: > >> > >> On Fri, Sep 17, 2010 at 4:32 AM, John Warburton <jwarburton@gmail.com> > >> wrote: > >> > Hi > >> > > >> > I would like to be able to access the hash "info2hash" in > >> > lib/puppet/provider/package/sun.rb which is a list of all Solaris > >> > packages > >> > on a Sun server > >> > > >> > >> It sounds like you want to subclass the provider yourself so you get > >> that hash/method for free. > >> > > I''m not really sure what that means, which might be my original problem. > > Does this mean editing/changing sun.rb or creating my own mysun.rb and > > somehow inherit sun.rb and all its goodies? > > > > Do you have any pointers where I can up to speed with this sort of thing? > > I mean the latter, inheritance. > > I would probably have a look at the apt* providers and how they > inherit from the dpkg provider? > > > > > > Thanks > > > > John > > > > -- > > 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<puppet-users%2Bunsubscribe@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > >-- John Warburton Ph: 0417 299 600 Email: jwarburton@gmail.com -- 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.