On Thursday, April 24, 2014 10:36:13 PM UTC+9, jcbollinger wrote: > > On Thursday, April 24, 2014 2:45:21 AM UTC-5, William Leese wrote: >> >> The accepted standard for sharing code seems to be modules, which doesn't >> seem a nice fit if you simply want to share a single custom Puppet function. >> >> Why not? >
Let me be more clear; I mean sharing on the Forge. It seems overkill to write a module file and upload a tarball just to share 2 small files (function & rspec). stdlib and some other modules provide a bundling of functions, when they're related (in function or acceptance by the community as standard library). But any 'bundle' without a clear designation is a poor fit for the forge because of lack of discoverability - I would have to add a tag for every keyword related to every function. > Having an easy way to look for Puppet functions would likely greatly help >> the development of such, providing a nice set of examples and avoiding >> duplicate work. >> > I don't follow. If you don't like modules for this purpose, then what > would be the characteristics of your ideal solution? > (Again, this is just about sharing on the forge) Perhaps a new type of resource on the Forge, with as big difference from the usual modules, that there's a fully searchable rubydoc and/or code. This way functions can easily be found that are developed by the community, that aren't coupled to a module (to install/manage X) per se. > Currently I simply create a module for each function and upload to the >> forge. Whats your approach? One monolithic module? Would that be easily >> findable on the Forge (tagging won't scale)? etc. etc. >> > > > Custom functions are valuable and widely used, but they are not a focal > feature of Puppet. It is uncommon for people to provide or seek a single > custom function in isolation. Instead, people usually are after a broader > facility. Typically that consists of classes and/or resource types (native > or defined), possibly with associated custom functions. In other words, a > module. > I avoid custom functions when possible, knowing that the more custom stuff I use, the more troublesome upgrades can become :) If you are writing custom functions so general that they are not associated > with any particular system configuration regime, then it might be suitable > to collect several into a library module. PuppetLabs's 'stdlib' module > follows this route (though it does provide a resource type or two along > with the many functions). > I find that I've developed only about a handful of useful but completely unrelated functions in a year, despite using Puppet extensively for almost 2 years. Perhaps my problem isn't well represented in the community and as such there is little need. I wrote this post hoping to find more people frustrated by rarely finding the documentation or examples they need to write (more than basic) Puppet functions, having to resort to reading through Puppets code. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/b8678167-6feb-44e5-b034-01426969585b%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.