Hello All, Does anyone have any good documentation, with examples, on writing providers? I have both the puppet books and I''ve been reviewing the various providers that are distributed w/puppet and modules but I''m not seeing things like how to properly execute commands, best way to parse output, or how to debug them during development. Thanks! -- Later, Darin -- 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.
I started by looking at this blog post: http://www.kartar.net/2010/02/puppet-types-and-providers-are-easy/ On Tuesday, September 25, 2012 6:09:30 PM UTC+3, Darin Perusich wrote:> > Hello All, > > Does anyone have any good documentation, with examples, on writing > providers? I have both the puppet books and I''ve been reviewing the > various providers that are distributed w/puppet and modules but I''m > not seeing things like how to properly execute commands, best way to > parse output, or how to debug them during development. > > Thanks! > > -- > Later, > Darin >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/i6tWBLcQOZgJ. 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.
On 09/25/2012 05:09 PM, Darin Perusich wrote:> Hello All, > > Does anyone have any good documentation, with examples, on writing > providers? I have both the puppet books and I''ve been reviewing the > various providers that are distributed w/puppet and modules but I''m > not seeing things like how to properly execute commands, best way to > parse output, or how to debug them during development. > > Thanks!I can send you my providers for Cobbler that I am writing. They are kinda simple so you can get around? Drop me a private mail if you want. -- 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.
I know that yours was more a question for the community but have you checked out: http://docs.puppetlabs.com/puppet/#hacking-and-extending If those aren''t super helpful we''d love to make them better. HTH, Justin On Tue, Sep 25, 2012 at 10:47 AM, Jakov Sosic <jsosic@srce.hr> wrote:> On 09/25/2012 05:09 PM, Darin Perusich wrote: >> Hello All, >> >> Does anyone have any good documentation, with examples, on writing >> providers? I have both the puppet books and I''ve been reviewing the >> various providers that are distributed w/puppet and modules but I''m >> not seeing things like how to properly execute commands, best way to >> parse output, or how to debug them during development. >> >> Thanks! > > I can send you my providers for Cobbler that I am writing. > > > They are kinda simple so you can get around? Drop me a private mail if > you want. > > -- > 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.
HI Justin, I have reviewed those documents and the Provider Development doc doesn''t tell me much more than what a provider does. There are no example other than how to set a command or limit to a certain system type. Take for example the docs on Using Parameterized Classes. I can take that document and after reading it can start writing a parameterized class to fit most situations, you can''t do that with the provider docs. -- Later, Darin On Tue, Sep 25, 2012 at 2:14 PM, Justin Stoller <justin@puppetlabs.com> wrote:> I know that yours was more a question for the community but have you > checked out: > http://docs.puppetlabs.com/puppet/#hacking-and-extending > > If those aren''t super helpful we''d love to make them better. > > > HTH, > Justin > > > On Tue, Sep 25, 2012 at 10:47 AM, Jakov Sosic <jsosic@srce.hr> wrote: >> On 09/25/2012 05:09 PM, Darin Perusich wrote: >>> Hello All, >>> >>> Does anyone have any good documentation, with examples, on writing >>> providers? I have both the puppet books and I''ve been reviewing the >>> various providers that are distributed w/puppet and modules but I''m >>> not seeing things like how to properly execute commands, best way to >>> parse output, or how to debug them during development. >>> >>> Thanks! >> >> I can send you my providers for Cobbler that I am writing. >> >> >> They are kinda simple so you can get around? Drop me a private mail if >> you want. >> >> -- >> 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. >-- 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.
On 09/25/2012 08:14 PM, Justin Stoller wrote:> I know that yours was more a question for the community but have you > checked out: > http://docs.puppetlabs.com/puppet/#hacking-and-extending > > If those aren''t super helpful we''d love to make them better.Hmm, I''ve read: http://docs.puppetlabs.com/guides/custom_types.html 2 or 3 times when I started, but somehow I missed the links to: http://docs.puppetlabs.com/guides/complete_resource_example.html and http://docs.puppetlabs.com/guides/provider_development.html Maybe you could add a link to next article at the end of the current one? Now that I''ve gone through the second one, I finally get the idea of param vs property. Also, I think you should add puppet code snippet in "Complete resource example", so that the reader can get an idea about how the puppet code will look like and how the "engine" (type/provider) behind it works and should be implemented. For someone who starts from scratch it''s hard to understand why all that code if you didn''t provide resource example for the code you want to write. So, IMHO, that article should look something like this: "if you want to write a custom type for foo, which has param bar and property boo, like this: foo {"myfoo": ensure => present, bar => ''something'', boo => ''something_else'', } you should start by coding type...." Or at lease, this kind of snippet should be present at the bottom of the article so people can connect those two things. Next thing I didn''t see is - when to use param and when to use property? What is current best practice and what do puppet-guys suggest... And finally - hashes... Maybe another (advanced) article describing hashes and how to generate hash from current system state, and how to apply settings from hash to the system (in property methods). I could help about this one because I''ve really pushed to get it done with just reading f5_pool and f5_message providers, and trying/failing consistently until I figured it out... -- Jakov Sosic www.srce.unizg.hr -- 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.