Hi,
First off... is these some pun I'm not getting, or was it supposed to
be "Holy Grail"? Just wondering :-)
The initial step of creating common guidelines for parameter names is
nice, as it can create some consistency across modules, and ease work
sharing as well as lower the learning curve for people using 3rd party
modules. But it would need to be official (in the puppet documentation
as best practices, for instance) and/or enforced on the forge, to
become really useful.
And after that, things quickly get exponentially complex IMHO. A few
examples from the top of my head :
* Naming the modules themselves.
* Naming the classes and definitions inside the modules.
* Multiple modules requiring the same packages (If my module needs
rsync, yours too, where do we put the common virtual resource?).
* The use of author-specific common modules (I don't like taking a
johndoe/apache module and noticing I then need johndoe/common).
But don't get me wrong, I like where this is headed, and will
participate as much as I can.
Puppet is a language and so people do the same things in different ways, and they all work and do what they are supposed to do.But if we think about modules REUSABILITY and INTEROPERABILITY some patterns have to be followed.
Some of the parameters described in the document are somehow REQUIRED, IMHO, if you want to make a really reusable module (for example the ones that let you decide how to manage your configuration files... if you enforce a logic in a module or a specific template and don't allow override by users, then you are not making a reusable module, so for example a parameter like "template" is just needed).
So, since, at least some of, these parameters are needed for a reusable module it's just a matter of defining few naming conventions (and managing external modules dependencies in a sane way) to make different modules happily live better together.
> Although I agree that to be reusable, modules need to provide certain types
> of levers, knobs, and switches, as appropriate for their scopes, I think the
> case is weak for those controls needing to be called by the same names. At
> best, naming conventions for such things might improve ease of (re)use for
> some people, but the key factor for reusability is not the names of the
> controls so much as their presence in the first place.
>
> I see implications for interoperability only insomuch as one imagines
> facilitating one module being a drop-in replacement for another, but (1)
> there's a lot more to that than just common naming, so (2) that kind of
> interoperability is unlikely to come about except by specific intention
> anyway, so in that case shared naming comes out as a project requirement.
> To me, that moots any general parameter-naming standard as far as
> interoperability goes.
I think being able to use another class in a drop-in way is not the
value I see in parameter naming 'recommendations'. I personal see
value in the ease of use more than anything, if parameters are
similarly named between classes, when you go to use them you don't
have to interrupt, double check with the docs what this class/define
uses, then modify your parameter name accordingly. Its a reduction in
surprise if anything. An example would be the 'package' parameter,
versus 'packages' ... if I didn't have to stop and check which one it
is for my XYZ class it might save time and mistakes *shrug*.
- Better user experience (modules are easier to use and understand)
- Quicker and more reliable Puppet manifests development (for basic functions you can expect predictable parameters)
- More coherent and error proof Puppet setups
- The possibility to have an unified approach to smoke testing of common features
- The possibility to have web front-ends and ENC that leverage on the standardized parameters
Is that valuable? Alas, I'm more of developer then user these days so
I would defer that to our users. As a developer though - I would find
it handy to have a guide for common things, I'm a pedant when it comes
to naming and if someone already came up with a name for me, I would
probably use it, presuming others have thought through any naming
consequences.
> None of that is a fundamental reason to object to the effort, but I'm not
> seeing any promise of significant benefit to motivate me to participate
> actively.
>
> I do have a bona fide objection, however: although the effort is cast at
> this point as being aimed exclusively at parameter naming, by implication it
> also covers elements of module structure, organization, and style as well,
> as the things being named have to exist for the standard to be relevant. I
> do understand that the intention is not to make all the standardized
> controls mandatory for every module, but for those that a given module does
> provide, even the standard's limited reusability and interoperability goals
> are not served if those controls are not located where the standard
> anticipates (which is for the most part on a single front-end class).
I've been pondering this situation as well. I presume in a world where
such recommendations become commonly used, the outcome would be
surprise at a missing 'recommended' parameter, then a subsequent bug
raised on the module due to its lack. This might be considered a
positive or negative. If the parameter name was named 'something else'
due to a feeling that the 'standard' is not covering a developers
needs, then this could be annoying to have that discussion _yet
again_. If however the functionality is simply missing - this becomes
a BAU patch (like the lint patches we see all the time) and probably a
positive feature request.
Of course, this all depends on how good the recommendations are.
Having looked through the document I think some of them are obvious,
and require less debate while other recommendations are less
obvious/contentious.
> Personally, I would rather see a white paper explaining what kinds of
> controls need to be available to facilitate reusability of various kinds of
> modules, and, optionally, setting out one or more models of how a module can
> provide those controls. Regardless of the nature of the paper's authorship,
> this feels like it should be a position paper, not a proposed standard.
Fair point, its a difficult document to position precisely. I guess I
foresee this as something that should be a part of a guide for writing
modules then any hard/fast rule or 'standard'.
Some personal notes among the lines...
On Tuesday, June 18, 2013 6:35:18 PM UTC+2, Ken Barber wrote:> Although I agree that to be reusable, modules need to provide certain types
> of levers, knobs, and switches, as appropriate for their scopes, I think the
> case is weak for those controls needing to be called by the same names. At
> best, naming conventions for such things might improve ease of (re)use for
> some people, but the key factor for reusability is not the names of the
> controls so much as their presence in the first place.Well on this I definitively do not agree :-)
For me a module is reusable when:
1- It supports many different OS (this is somehow implicit and does not involve naming conventions)2- It leaves to the user freedom on how to populate and customize the provided configuration files ( I think this is the main point for most reusability cases)
3- It allows the user to manage some behaviours of the module (has a service to be restarted after a file change? Do I want to manage a service status (at runtime or boot)
4- In (somehow extreme) cases it allows the user to customize names of package/services, paths of files and so on5- It allows seamless addition of custom resources, not managed by the module but related to it6- It allows the user to decide where to place his data (also this is out of naming convention scope)Given these points, I think that some of the parameters names proposed in the draft actually DO inherently enhance a module reusability:
For point 2: source, template, options (with might make useless almost any additional application specific configuration parameter), dir_source (and dir_* )
For point 3: status, autorestart (poor name), audits, noopsFor point 4: package, service, file_path, dir_pathFor point 5: my_class resources_hashBut maybe we have different semantic nuances for the term "modules' reusability".
I agree that the interoperability part is not fully dependent on naming standards.Aa a partial solution for this I have thought about the usage of a "dependency_class" to contain in a single, replaceable, class all the external dependencies, and eventually tweaking the Modulefile and the puppet module command to manage soft-dependencies and reduce conflicts modules Forge modules (more details on this on the blog post linked before).I don't see it as a perfect solution but that's something that can be done now (without extra code if not for the Forge integration) and very quickly.
I think being able to use another class in a drop-in way is not the
value I see in parameter naming 'recommendations'. I personal see
value in the ease of use more than anything, if parameters are
similarly named between classes, when you go to use them you don't
have to interrupt, double check with the docs what this class/define
uses, then modify your parameter name accordingly. Its a reduction in
surprise if anything. An example would be the 'package' parameter,
versus 'packages' ... if I didn't have to stop and check which one it
is for my XYZ class it might save time and mistakes *shrug*.Let me clarify that hardly in my dreams I could imagine seamless drop-in replacements, but naming standards+dependency_class pattern CAN make interoperability much easier.
For the other benefits, least surprise is one point, not small as it involves (let me copy and paste :-):- Better user experience (modules are easier to use and understand)
- Quicker and more reliable Puppet manifests development (for basic functions you can expect predictable parameters)
- More coherent and error proof Puppet setups
but I see various other clear benefits, in the mid term:- The possibility to have an unified approach to smoke testing of common features
- The possibility to have web front-ends and ENC that leverage on the standardized parameters
- Easier integration with superclasses that expose their own parameters and use different modules to build up full applications stacks or complex setups that involve multiple modules.
- A PuppetLabs and/or Community driven central repository of well tested and features rich unique Standard modules
(it might be a subset of the Forge or a set of git repos with only one module for application)
> None of that is a fundamental reason to object to the effort, but I'm not
> seeing any promise of significant benefit to motivate me to participate
> actively.
>
> I do have a bona fide objection, however: although the effort is cast at
> this point as being aimed exclusively at parameter naming, by implication it
> also covers elements of module structure, organization, and style as well,
> as the things being named have to exist for the standard to be relevant. I
> do understand that the intention is not to make all the standardized
> controls mandatory for every module, but for those that a given module does
> provide, even the standard's limited reusability and interoperability goals
> are not served if those controls are not located where the standard
> anticipates (which is for the most part on a single front-end class).The assumption is that parameters are passed to the main module class or to single specific defines.
This is the only constraint to the module structure then you can organize the modules as you want.
Fair point, its a difficult document to position precisely. I guess I
foresee this as something that should be a part of a guide for writing
modules then any hard/fast rule or 'standard'.Call it position paper or draft for a proposed standard, what's important, imho, is the final goal:
some recommendations for naming conventions to use in modules (parameters) that can help in making some order in the modules' casbah while suggestion patterns that enhance reusability and may improve interoperabiity.
Since it's at least 3 years that there're some sparse discussions about modules reusability I preferred to give some solid ground upon which have a discussion, for this reason I placed the links of the stdmod sample modules and the Google Doc.
Please consider this as a starting point to improve and eventually radically change (draft for 0.0.1 means that there's STILL to be a 0.0.1 and whatever comes after).
Thank you guys for the insights, hope to see your contributions to the Doc, both for the parts that find you skeptic and the parts you agree upon. I think it's important to do something that is well thought and shared but is even more important to start to do it, step by step, and I hope we all agree that is is something to do, sooner or later to avoid total chaos and fragmentation in the modules ecosystem.
Basically, I am drawing the line at having to modify the code to use a third-party module. The module is "reusable" if I do not have to modify it, even if I have to study it to determine how to use it. It is easy to use if it presents a coherent, intuitive external interface. Almost all naming considerations fall into the latter category.
Moreover, any ease of use advantage of such a convention is limited to those users who buy in to the convention. Such buy-in is unlikely to arise from a standard-setting effort alone.
I agree that the interoperability part is not fully dependent on naming standards.Aa a partial solution for this I have thought about the usage of a "dependency_class" to contain in a single, replaceable, class all the external dependencies, and eventually tweaking the Modulefile and the puppet module command to manage soft-dependencies and reduce conflicts modules Forge modules (more details on this on the blog post linked before).I don't see it as a perfect solution but that's something that can be done now (without extra code if not for the Forge integration) and very quickly.
I have some issues with that approach, but I'm going to disregard them for now because that topic is largely beyond the stated scope of the naming conventions and convention-drafting effort we are discussing.
I think being able to use another class in a drop-in way is not the
value I see in parameter naming 'recommendations'. I personal see
value in the ease of use more than anything, if parameters are
similarly named between classes, when you go to use them you don't
have to interrupt, double check with the docs what this class/define
uses, then modify your parameter name accordingly. Its a reduction in
surprise if anything. An example would be the 'package' parameter,
versus 'packages' ... if I didn't have to stop and check which one it
is for my XYZ class it might save time and mistakes *shrug*.Let me clarify that hardly in my dreams I could imagine seamless drop-in replacements, but naming standards+dependency_class pattern CAN make interoperability much easier.
So, then, this really isn't just a question of naming things, as previously claimed? I mean, I know I made that very observation in my previous post, but I had assumed that it was just an aspect of the proposal that you hadn't recognized and appreciated, not an intentional subterfuge.
For the other benefits, least surprise is one point, not small as it involves (let me copy and paste :-):- Better user experience (modules are easier to use and understand)
- Quicker and more reliable Puppet manifests development (for basic functions you can expect predictable parameters)
- More coherent and error proof Puppet setups
Least surprise applies only if I have a reason to expect particular conventions to be followed. If not, then I cannot be surprised. In a sense, then, the opportunity for surprise is a cost of such conventions as are proposed, partially offsetting the potential ease of use advantages for modules that conform with such a convention. And again, I do not deny that there are potential ease of use advantages associated with shared conventions, but that comes not from the conventions themselves, but rather from their broad acceptance and use.
but I see various other clear benefits, in the mid term:- The possibility to have an unified approach to smoke testing of common features
- The possibility to have web front-ends and ENC that leverage on the standardized parameters
If there were good tools available for those applications then they might provide an impetus toward conformance with the proposed conventions. However, I think adopting conventions on the hope that such tools will materialize in the future is unwise. Call me "experienced", "jaded", or even "cynical", but I know of too many instances of vaporware to be swayed by promises of software that hasn't yet been written.
- Easier integration with superclasses that expose their own parameters and use different modules to build up full applications stacks or complex setups that involve multiple modules.
Sorry, I'm not seeing it.
- A PuppetLabs and/or Community driven central repository of well tested and features rich unique Standard modules
(it might be a subset of the Forge or a set of git repos with only one module for application)
Yes, the idea of a curated repository of interoperable modules has been raised before. I think it's a fine idea, but I don't think it depends on parameter naming conventions for realization. In fact, I don't think parameter naming conventions actually bring much to that particular table.
> None of that is a fundamental reason to object to the effort, but I'm not
> seeing any promise of significant benefit to motivate me to participate
> actively.
>
> I do have a bona fide objection, however: although the effort is cast at
> this point as being aimed exclusively at parameter naming, by implication it
> also covers elements of module structure, organization, and style as well,
> as the things being named have to exist for the standard to be relevant. I
> do understand that the intention is not to make all the standardized
> controls mandatory for every module, but for those that a given module does
> provide, even the standard's limited reusability and interoperability goals
> are not served if those controls are not located where the standard
> anticipates (which is for the most part on a single front-end class).The assumption is that parameters are passed to the main module class or to single specific defines.
This is the only constraint to the module structure then you can organize the modules as you want.
It is a non-trivial constraint that all of a module's external interface be implemented in the form of a single class and zero or more types (and zero or more custom functions, heretofore not discussed). That it can be expressed in one sentence does not make it less significant. Furthermore, there is an implicit assumption even in that admission: that module interfaces will involve parameterized classes. That in itself is probably not a big deal any longer, but some of the prospective advantages claimed seem predicated on the premise that parameterized-style class declarations will be used. That is a big deal, especially given that a large ecosystem of mutually interoperable modules is hypothesized as a viable and likely outcome.
Most importantly, however, my central objection here is that a proposal that purports to be exclusively about naming parameters in fact has any implications at all for module organization and style.
Fair point, its a difficult document to position precisely. I guess I
foresee this as something that should be a part of a guide for writing
modules then any hard/fast rule or 'standard'.Call it position paper or draft for a proposed standard, what's important, imho, is the final goal:
The names of things matter, as indeed this whole discussion presupposes. How people respond to the initiative will be colored on many levels by what you call it and how you position it. In fact, I might not have joined the discussion if the effort had been positioned as targeting a set of common conventions, but setting a standard is a rather different endeavor.
some recommendations for naming conventions to use in modules (parameters) that can help in making some order in the modules' casbah while suggestion patterns that enhance reusability and may improve interoperabiity.
Since it's at least 3 years that there're some sparse discussions about modules reusability I preferred to give some solid ground upon which have a discussion, for this reason I placed the links of the stdmod sample modules and the Google Doc.
Please consider this as a starting point to improve and eventually radically change (draft for 0.0.1 means that there's STILL to be a 0.0.1 and whatever comes after).
Thank you guys for the insights, hope to see your contributions to the Doc, both for the parts that find you skeptic and the parts you agree upon. I think it's important to do something that is well thought and shared but is even more important to start to do it, step by step, and I hope we all agree that is is something to do, sooner or later to avoid total chaos and fragmentation in the modules ecosystem.
I think you have embarked on a worthy effort, but I also think your aspirations are too grand. Build it, with as much community participation as you can reasonably accommodate, and let the result speak for itself. If it succeeds well in everything you envision then it is likely to be well received and broadly implemented.
But do not set out with the expectation of that the result will be adopted or used otherwise, and certainly do not create a chicken-and-egg problem, where the effort's success depends on it being successful.
On Wednesday, June 19, 2013 5:03:41 PM UTC+2, jcbollinger wrote:Call me "experienced", "jaded", or even "cynical", but I know of too many instances of vaporware to be swayed by promises of software that hasn't yet been written.I just call you cynical. We can't do anything if we don't try to do it.
A really reusable module HAS to be parametrized.
Take note, I can repeat and argument that anytime.
Parameters are the API of a module, the interface you can interact with it without touching it.
If you don't use parameters either you are forcing inside the module behaviours that can't be changed by users or you are forcing a specific way to obtain the data that affects the modules behaviour and this inherently makes it not reusable for people who provide data in other ways.
Most importantly, however, my central objection here is that a proposal that purports to be exclusively about naming parameters in fact has any implications at all for module organization and style.Ok, it's not a proposal that purports to be exclusively about naming parameters: the usage of specific parameters involve patterns that enhance modules' reusability and interoperability.
The sample module code definitively exposes design patterns with modules (and it demonstrates that you can follow different patterns to achieve the same behaviour.
Reading it again this is not so clear in the first post here, but it's widely expressed in the linked pages.
So, sorry, now let's move a step further, let's talk, if you want, about how to make that paper/draft/proposal better.
And if you think that such a thing should not even be discussed, well, ok, I'll accept that and discuss it with who is interested in it.
On Wednesday, June 19, 2013 5:34:58 PM UTC-5, Alessandro Franceschi wrote:
On Wednesday, June 19, 2013 5:03:41 PM UTC+2, jcbollinger wrote:Call me "experienced", "jaded", or even "cynical", but I know of too many instances of vaporware to be swayed by promises of software that hasn't yet been written.I just call you cynical. We can't do anything if we don't try to do it.
By all means, do. If you are somehow getting the impression that I object to the project then I apologize. Indeed, I encourage you to proceed, and I wish you well. I just have low regard for software that doesn't yet exist. I do not find the potential for nebulous future software a persuasive argument for adopting anything.
What I actually object to is misrepresentation -- even though accidental -- of the nature and scope of the project. It is NOT restricted to choosing names.
Secondarily, I object to positioning the effort as a standardization project, and I advise you to position it differently. Names and labels are meaningful. How the project proceeds, who participates, what they propose, and all manner of intangibles will be influenced by your decisions in this regard. Frankly, I am inclined to resist a "standardization" effort from any random third party, but I have no reason whatever to oppose anyone drafting a set of conventions or best practices. After they have been tested in the field will be a suitable time to consider standardization or endorsement.A really reusable module HAS to be parametrized.
Utter hogwash.
Take note, I can repeat and argument that anytime.
Then no doubt we'll be hearing from each other on this again.
Parameters are the API of a module, the interface you can interact with it without touching it.
If you don't use parameters either you are forcing inside the module behaviours that can't be changed by users or you are forcing a specific way to obtain the data that affects the modules behaviour and this inherently makes it not reusable for people who provide data in other ways.
The data consumed by a module and the labels by which they are identified are certainly parts of a module's API, but it is by no means necessary to express those or interact with them in the form of class parameters. You cannot safely use parameterized-style class declarations (as opposed to class definitions) of any API class, especially in or with modules intended to be interoperable. That makes parameterization largely moot as far as reusability goes. If people want to parameterize their classes then I have no special reason to object. I do object, however, to the premise that doing so usefully improves reusability or interoperability, and therefore I object to any proposal that expressly calls for classes to be parameterized.
As long as we're talking about standards, Hiera is Puppet's de facto standard interface to external data. It is usually expected that proposed standards will build on other, existing standards, whether de facto or formal.
I think your proposal would be stronger if it truly did focus on the data that might need to be supported by modules and the names / labels / keys by which they are identified. If you choose a namespace-based system then you can align it to be consistent with class parameterization and automated parameter binding, yet not dependent on those. I know you want more, but you should consider making a separate effort of the rest.
Most importantly, however, my central objection here is that a proposal that purports to be exclusively about naming parameters in fact has any implications at all for module organization and style.Ok, it's not a proposal that purports to be exclusively about naming parameters: the usage of specific parameters involve patterns that enhance modules' reusability and interoperability.
The sample module code definitively exposes design patterns with modules (and it demonstrates that you can follow different patterns to achieve the same behaviour.
Reading it again this is not so clear in the first post here, but it's widely expressed in the linked pages.
So, sorry, now let's move a step further, let's talk, if you want, about how to make that paper/draft/proposal better.
And if you think that such a thing should not even be discussed, well, ok, I'll accept that and discuss it with who is interested in it.
I think it would be better if it actually were narrowed in scope to identifying patterns in the data that modules consume, and choosing naming conventions for those data. Better, and also easier to reach consensus on. Include some comments about namespacing, especially in conjunction with accessing data via Hiera. These issues are separate from and more fundamental than class parameterization or module organization. They will, however, influence anyone who chooses to write modules with parameterized API classes.
> - The possibility to have an unified approach to smoke testing of common features
> - The possibility to have web front-ends and ENC that leverage on the standardized parameters
On Thursday, June 20, 2013 4:12:46 PM UTC+2, jcbollinger wrote:
On Wednesday, June 19, 2013 5:34:58 PM UTC-5, Alessandro Franceschi wrote:A really reusable module HAS to be parametrized.
Utter hogwash.Lol. Show me a real example of a reusable module without parametrized classes that at least manages a typical package/service/configuration file scenario.Give me proofs, not words that I have to search on a dictionary.
On Thursday, June 20, 2013 10:14:09 AM UTC-5, Alessandro Franceschi wrote:
On Thursday, June 20, 2013 4:12:46 PM UTC+2, jcbollinger wrote:
On Wednesday, June 19, 2013 5:34:58 PM UTC-5, Alessandro Franceschi wrote:A really reusable module HAS to be parametrized.
Utter hogwash.Lol. Show me a real example of a reusable module without parametrized classes that at least manages a typical package/service/configuration file scenario.Give me proofs, not words that I have to search on a dictionary.
Anything you can configure with class parameters, you can configure without them via external data. Generally speaking, I would turn to hiera for that. If you want an ENC that surpasses hiera's built-in capabilities, then it can be written in the form of a custom hiera back-end.
On the other hand, if your criterion for a module being "reusable" is that it can be used in every way exactly as a module based on parameterized classes can be used, then the question is rigged.
That hiera was not built-in to Puppet 2 does not alter my evaluation here. It is readily available and widely used with that series. I have always held that parameterized classes were not safe to use in Puppet 2 anyway, so if the objective is modules that are reusable in Puppet 2 then I would go beyond "parameterization is not required" to "parameterization of API classes is forbidden". That leaves you with dynamic scoping and extlookup() as your only built-in alternatives, and however suitable they may be (or not) for Puppet 2, they are not suitable for Puppet
If the objective is for modules to be written so as to be usable in both Puppet 2 and Puppet 3, then I think Hiera is the only viable alternative. Classes belonging to module APIs must not be declared via the parameterized style, and though avoiding that in Puppet 2 could be supported by using hiera() calls for parameter default values, writing API classes that way produces (i) worse compilation performance in Puppet 3, and (ii) the opportunity for users to shoot themselves in the foot.
I'd like to say I really like the intent behind this.
Yes, a name is important. So is continuity. I believe the underlying goal is to provide a collection of reference material. Once the skeleton of this material is generally agreed upon, it can be used as guidelines to the community for how to implement a common set of functionality with performance, and the greatest quantity of interoperability in mind.
How is this a bad thing?
The demonstrated example shows plenty of well thought out functionality. How might we better implement these functional knobs and levers?
Lets go beyond the fact that the only reason we call knobs, switches, and levers what we do is that communally we agreed that this long-ish thing protruding from this surface over here should be called a lever, that this definitive state toggle be called a switch, and this round, grabbable twisty thing here should be called a knob. Names are important, but not just because they're names, they're icons of functionality.
Consistently referring to a lever as a lever provides more intuitive context, but doesn't change how it operates. Does it do the same thing if you call it a widget? Sure! Does it help with the goal of communally establishing conventions of grounding and interoperability? Not so much.
So, on the one hand, no, this conversation is not purely about naming conventions. On the other, I don't think that's the point to focus on.
I can absolutely see the value in a few sets of versioned "interoperability reference" modules, which provide one a good working model of how to provide specific bits of functionality in as flexible a manner as necessary.
There are several different good module paradigms out there. I feel that fragmentation of design and implementation hinders the community more than a little bit. It confuses it, at the very least.
I do not believe a 'one-size-fits-all' paradigm would do us all that much good here either. You'd likely always be one side or the other of too much scaffolding for simple modules, and not enough flexibility for complicated ones.
I believe this means a few levels of module complexity would need to be modeled. Then the transitions between those states would be more straightforward. Someone could expand the functionality of your module with greater ease and consistency.
I would love to see other examples which provide similar levels of implemented functionality.
(... (:(: and then the bikeshedding and performance holy wars can really get going :):) ...)
What other good ways are there to easily write unit tests to validate the different behaviors of a module without parameters?
Facts?
Limited scope/functionality subclasses?
This is a very exciting subject of conversation. I am thankful to everyone participating in it for their thoughts and contributions.
On Friday, June 21, 2013 5:05:20 PM UTC+2, jcbollinger wrote:Anything you can configure with class parameters, you can configure without them via external data. Generally speaking, I would turn to hiera for that. If you want an ENC that surpasses hiera's built-in capabilities, then it can be written in the form of a custom hiera back-end.
On the other hand, if your criterion for a module being "reusable" is that it can be used in every way exactly as a module based on parameterized classes can be used, then the question is rigged.
That hiera was not built-in to Puppet 2 does not alter my evaluation here. It is readily available and widely used with that series. I have always held that parameterized classes were not safe to use in Puppet 2 anyway, so if the objective is modules that are reusable in Puppet 2 then I would go beyond "parameterization is not required" to "parameterization of API classes is forbidden". That leaves you with dynamic scoping and extlookup() as your only built-in alternatives, and however suitable they may be (or not) for Puppet 2, they are not suitable for Puppet
If the objective is for modules to be written so as to be usable in both Puppet 2 and Puppet 3, then I think Hiera is the only viable alternative. Classes belonging to module APIs must not be declared via the parameterized style, and though avoiding that in Puppet 2 could be supported by using hiera() calls for parameter default values, writing API classes that way produces (i) worse compilation performance in Puppet 3, and (ii) the opportunity for users to shoot themselves in the foot.Still words and no samples John.
On Friday, June 21, 2013 6:21:22 PM UTC-5, Alessandro Franceschi wrote:
On Friday, June 21, 2013 5:05:20 PM UTC+2, jcbollinger wrote:Anything you can configure with class parameters, you can configure without them via external data. Generally speaking, I would turn to hiera for that. If you want an ENC that surpasses hiera's built-in capabilities, then it can be written in the form of a custom hiera back-end.
On the other hand, if your criterion for a module being "reusable" is that it can be used in every way exactly as a module based on parameterized classes can be used, then the question is rigged.
That hiera was not built-in to Puppet 2 does not alter my evaluation here. It is readily available and widely used with that series. I have always held that parameterized classes were not safe to use in Puppet 2 anyway, so if the objective is modules that are reusable in Puppet 2 then I would go beyond "parameterization is not required" to "parameterization of API classes is forbidden". That leaves you with dynamic scoping and extlookup() as your only built-in alternatives, and however suitable they may be (or not) for Puppet 2, they are not suitable for Puppet
If the objective is for modules to be written so as to be usable in both Puppet 2 and Puppet 3, then I think Hiera is the only viable alternative. Classes belonging to module APIs must not be declared via the parameterized style, and though avoiding that in Puppet 2 could be supported by using hiera() calls for parameter default values, writing API classes that way produces (i) worse compilation performance in Puppet 3, and (ii) the opportunity for users to shoot themselves in the foot.Still words and no samples John.
None of my modules have any parameterized classes, but I am not at liberty to publish them. I can derive an example from someone else's module -- maybe yours -- and I will do so if you're actually interested. However, you have now said at least twice that that's not what you want to talk about, and I'm not inclined to do the work if you're not interested in the result.
Either way, whether such modules are common is altogether beside the (my) point, which is about whether conventions such as you wish to develop and promote should require modules' API classes to be parameterized. I will oppose that aspect of any such effort.
The more fundamental idea of a common mapping of data and data types to names (i.e. a data "ontology"), on the other hand, is an outstanding idea. If the discussion is at that level then it will certainly keep my interest, and it may attract my active participation.
On Monday, June 24, 2013 3:57:55 PM UTC+2, jcbollinger wrote:None of my modules have any parameterized classes, but I am not at liberty to publish them. I can derive an example from someone else's module -- maybe yours -- and I will do so if you're actually interested. However, you have now said at least twice that that's not what you want to talk about, and I'm not inclined to do the work if you're not interested in the result.I'm still interested in seeing how this can be done, so any sample code useful to understand the approach would be extremely welcomed.Just an example, then we can move on.
On Monday, June 24, 2013 9:12:17 AM UTC-5, Alessandro Franceschi wrote:
On Monday, June 24, 2013 3:57:55 PM UTC+2, jcbollinger wrote:None of my modules have any parameterized classes, but I am not at liberty to publish them. I can derive an example from someone else's module -- maybe yours -- and I will do so if you're actually interested. However, you have now said at least twice that that's not what you want to talk about, and I'm not inclined to do the work if you're not interested in the result.I'm still interested in seeing how this can be done, so any sample code useful to understand the approach would be extremely welcomed.Just an example, then we can move on.
So, here is a version of puppet-stdmod without class parameterization: https://github.com/jcbollinger/puppet-stdmod .
All management capabilities of the original module are retained. Customization data are provided to it via Hiera (which the module calls explicitly), so the most significant change was simply to convert parameters to ordinary variables initialized vie Hiera.
The conversion was not entirely mechanical, in that I had to accommodate some Hiera idiosyncrasies -- mainly that it cannot return either undef or (boolean) false. Inasmuch as one would like the parameterized version to be fully compatible with automatic parameter binding, however, I would account at least some of those adaptations as usability enhancements with respect to the parameterized version.
I did not convert the tests.
Also, I do not specially endorse stdmod's particular design (either version). I would write it at least a bit differently if doing so from scratch, but I think we've agreed to turn the discussion in a different direction.
John
I have been watching this thread grow and metastasize and I would like to offer my opinions:
"The wonderful thing about standards is that there are so many of them to choose from." Grace Hopper (maybe)
There are at least two very different directions to approach this from, IMHO.
The first is from the idea to create a universally useable module that can be dropped into any puppet master and run without modification. This seems to me to be the approach of Example-42.
The other approach is to provide a set of common sense, best-practice guidelines for folks to use to "grow" their own modules for their own specific needs.
I think both are necessary and valuable.
My grumble about the Example-42-Swiss-Army-Knife approach is that I would like to know what is absolutely necessary and what is optional. I do not want to implement the equivalent of the Sears Craftsman Gazillon Piece Tool Warehouse when all I need is one lousy Phillip's screwdriver.
I have dug thru some of the Example 42 modules and I have learned more than a few nifty ways of getting things done, but I am working in a one-operating-system environment (Red Hat) and I do not need all the extra code to cover the other OS's.
Other grumbles (not only about Example 42) include sparse documentation and examples: If you are going to define a pile of parameters, it would be very helpful to include examples to show how to use them. Very few published modules provide enough detail to make me happy.
The old saying is "There's more than one way to skin a cat." (My apologies to all ailurophiles out there, of which I am one)
Same thing here. Puppet is a potentially powerful framework for system configuration and management. If you are sloppy about how you use it, you can booger up your systems big-time and lose important data.
Exactly how to do it all is not as important (IMHO) as learning right and wrong ways to do individual tasks. It is then up to the individual DevOp to tailor the pieces to fit their particular needs and environment.
Given the sample names below, there are at least 2 different approaches that can be followed, and once defined all the parameters names can somehow emerge naturally:
1- Place a common suffix for any kind of parameter
2- Place suffixes for some specific params and leave more general names of general ones
Examples for case 1 package_name | Examples for case 2 package |
On Tuesday, June 25, 2013 9:16:20 PM UTC+2, jcbollinger wrote:So, here is a version of puppet-stdmod without class parameterization: https://github.com/jcbollinger/puppet-stdmod .Ok, this is what I expected.
Thank you for your time.
I can definitively argue that this is not fully reusable("So please show me a reusable module without parameters and without hiera functions inside, as that would not be reusable by whoever does not use Hiera.")
Yes,let's go on.
I guess the first steps should be to identify a coherent naming pattern, even before single names and define more precisely what parameters might be recommended, optional, or considered "extensions" .
On Tuesday, June 25, 2013 4:49:49 PM UTC-5, Alessandro Franceschi wrote:
On Tuesday, June 25, 2013 9:16:20 PM UTC+2, jcbollinger wrote:So, here is a version of puppet-stdmod without class parameterization: https://github.com/jcbollinger/puppet-stdmod .Ok, this is what I expected.
Of course it is. I told you in advance what it was going to be.
Thank you for your time.
I can definitively argue that this is not fully reusable("So please show me a reusable module without parameters and without hiera functions inside, as that would not be reusable by whoever does not use Hiera.")
And I rejected that standard of reusability, for sound reasons that you did not rebut. Since we are closing off that line of discussion, we will have to agree to disagree.
Yes,let's go on.
I guess the first steps should be to identify a coherent naming pattern, even before single names and define more precisely what parameters might be recommended, optional, or considered "extensions" .
Before any decision is made on naming patterns -- or at least in conjunction with that -- don't you think we should come to grips with the patterns of data to which we hope to assign names? The Google doc does address that topic, at least implicitly, but I think we should be satisfied with the coverage and characterization of the data, else we cannot be confident that the chosen names are the most appropriate ones. I will devote some attention to that, but I hope I will not be the only one to do so.
For me a module is reusable when:
1- It supports many different OS (this is somehow implicit and does not involve naming conventions)2- It leaves to the user freedom on how to populate and customize the provided configuration files ( I think this is the main point for most reusability cases)
3- It allows the user to manage some behaviours of the module (has a service to be restarted after a file change? Do I want to manage a service status (at runtime or boot)
4- In (somehow extreme) cases it allows the user to customize names of package/services, paths of files and so on5- It allows seamless addition of custom resources, not managed by the module but related to it6- It allows the user to decide where to place his data (also this is out of naming convention scope)
Hi Al, et al. I apologize for being so late to this party but I'm loving all the conversation around this. I've read through the Google Doc and found lots of cool ideas on class parameter names. Please forgive me though, my product manager wired brain wants to pause at this point and discuss it a bit first before I offer my opinions on the doc.
On Tue, Jun 18, 2013 at 11:19 AM, Alessandro Franceschi <a...@lab42.it> wrote:For me a module is reusable when:
1- It supports many different OS (this is somehow implicit and does not involve naming conventions)2- It leaves to the user freedom on how to populate and customize the provided configuration files ( I think this is the main point for most reusability cases)
3- It allows the user to manage some behaviours of the module (has a service to be restarted after a file change? Do I want to manage a service status (at runtime or boot)
4- In (somehow extreme) cases it allows the user to customize names of package/services, paths of files and so on5- It allows seamless addition of custom resources, not managed by the module but related to it6- It allows the user to decide where to place his data (also this is out of naming convention scope)
I'll admit that this is my Forge biased view of things, but I'm working towards modules that are reusable, interoperable and introspectable. It would help me contribute to the discussion if we could hammer out whether we loosely agree on the goal and definitions. I'm already pretty happy with your definition of reusable, but I'll paraphrase.Interoperable
- Module A is known to do X, Y & Z.
- Module B also does X, Y & Z and can seamlessly replace module A
Reusable
- Supports multiple operating systems with a clear & standard pattern for adding additional OSes
- General capabilities of module can be switched on or off or lightly modified. Ex., don't manage services or override configuration directory.
One way that we differ immediately on reusability is that you're pretty detailed on what you should be able to customize, like package and service names. I don't disagree with you but I'm trying to start from a higher level and see whether that's sufficient. I'm not sure what the balance is regarding # of class parameters in use / ease of use.
Introspectable
- Code follows style guide and other patterns so that contributions are more easily made and managed.
- Puppet should be able to programmatically tell us about defined class parameters and their default values. (yeah, this is theoretical atm)
Are these three goals and their values what we're all striving for with this proposal? If not, what am I missing or getting wrong?
Thanks for kicking this off Al. I also care deeply about this stuff and will be trying to carve off more time each week to help you continue to explore it.
Dear all,I'd like to submit to the list's attention this post about Puppet Modules Standard naming conventions:
http://www.example42.com/?q=The_handy_Grail_of_Modules_Standardsand this working draft of a proposal for a version 0.0.1 of them:The topic is not new, and on this list there have already been various discussions on how to manage modules' interoperability ( for example this interesting one on cross-modules dependencies: https://groups.google.com/forum/?fromgroups#!searchin/puppet-users/modules$20standards|sort:date/puppet-users/Fvl0aOe4RPE) .
Along with the current discussions on the topic and the Puppet evolution, I think that few simple *suggested* naming conventions on common parameters for classes and defines would benefit a lot the module's ecosystem with a small effort.
I hope the discussion will have a real follow up, this time, and possibly move under the more authoritative PuppetLabs umbrella, for the moment is just a personal proposal, even if shared, at least in the intentions, with many modules' authors and Puppetteers.
You can actively contribute to the proposed naming standards on the above Google document (let me know your gmail account) and you are invited to comment here what do you think of this (not new) idea: if you think that starting from simple naming convention is a step to be done, what's your general idea on the proposed naming standards, if you have better ideas on naming and approach.
Let's grab this handy Grail :-)Alessandro FranceschiExample42
On Monday, July 1, 2013 5:21:44 AM UTC+2, Ryan Coleman wrote:Hi Al, et al. I apologize for being so late to this party but I'm loving all the conversation around this. I've read through the Google Doc and found lots of cool ideas on class parameter names. Please forgive me though, my product manager wired brain wants to pause at this point and discuss it a bit first before I offer my opinions on the doc.On Tue, Jun 18, 2013 at 11:19 AM, Alessandro Franceschi <a...@lab42.it> wrote:
For me a module is reusable when:
1- It supports many different OS (this is somehow implicit and does not involve naming conventions)2- It leaves to the user freedom on how to populate and customize the provided configuration files ( I think this is the main point for most reusability cases)
3- It allows the user to manage some behaviours of the module (has a service to be restarted after a file change? Do I want to manage a service status (at runtime or boot)
4- In (somehow extreme) cases it allows the user to customize names of package/services, paths of files and so on5- It allows seamless addition of custom resources, not managed by the module but related to it6- It allows the user to decide where to place his data (also this is out of naming convention scope)
I'll admit that this is my Forge biased view of things, but I'm working towards modules that are reusable, interoperable and introspectable. It would help me contribute to the discussion if we could hammer out whether we loosely agree on the goal and definitions. I'm already pretty happy with your definition of reusable, but I'll paraphrase.Interoperable
- Module A is known to do X, Y & Z.
- Module B also does X, Y & Z and can seamlessly replace module AAgree, and to clarify this even more:
If module C needs X which is provided by module A and B:
- A and B should be seamless replaceable (as you said)
- C should allow easy selection (for the user) of another module that provides XThis second point might look redundant, given the first one, but it might be necessary since seamless replacement of modules won't be easy to achieve OR a user may want to use a module that does not support the standard namings.An approach for this second point is the usage of a dependency_class parameter (details in the Google Doc), but I'm sure the collective wisdom here may find a better solution.
Also this interoperability should be somehow managed at Modulefile level (and with the puppet module command), so that I can use B even if in the Modulefile is required A.
This part, which involves changes in Puppet's code, has to be somehow addressed sooner or later, IMHO.
Reusable
- Supports multiple operating systems with a clear & standard pattern for adding additional OSes- General capabilities of module can be switched on or off or lightly modified. Ex., don't manage services or override configuration directory.
One way that we differ immediately on reusability is that you're pretty detailed on what you should be able to customize, like package and service names. I don't disagree with you but I'm trying to start from a higher level and see whether that's sufficient. I'm not sure what the balance is regarding # of class parameters in use / ease of use.
The idea is that you are not forced to provide all the "proposed" parameters, but if some of the parameters you provide in your module have the same function of the ones proposed, you should call them in the "standard" way.We might classify parameters in different ways, so that some should be considered somehow recommended (for a "standard module"), other optional, and other "extra" or "enhanced", because more specific and exotic (thinking about the ones related to monitoring/firewalling, for example).
Introspectable
- Code follows style guide and other patterns so that contributions are more easily made and managed.
- Puppet should be able to programmatically tell us about defined class parameters and their default values. (yeah, this is theoretical atm)+1, but with a small note:Even if I think it can be useful to provide some recommended patterns for modules design, this is a somehow more controversial and debatable matter (as the discussion with John in this thread may suggest) so I would not couple it strictly with the discussion about naming standards which it's, imho, more easy to stage and manage.
No problems for me in facing all the different problematics behind modules standards, but I'd suggest to make small steps and begin with the easier ones, since putting too many topics in the cauldron and keeping them tied together might make harder any improvement.
Are these three goals and their values what we're all striving for with this proposal? If not, what am I missing or getting wrong?I think we agree on the overall goals.Actually you've added the one about introspectability that is a welcomed addition but it partly relies upon features that are still missing in Puppet.
My starting approach was to concentrate on things that can be done now, with the current Puppet versions (I'd leverage on Puppet 3, though, since we are talking about the future modules) and giving common names to common sense parameters seemed a minimal logical step.
Nevertheless, it's important to conduct this discussion in pair with the expected evolutions of Puppet, so that we can define something that makes sense now and will make sense in the future.
Thanks for kicking this off Al. I also care deeply about this stuff and will be trying to carve off more time each week to help you continue to explore it.Thanks to you Ryan for supporting this, PuppetLabs' influence on the matter is vital.
Al--
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...@googlegroups.com.
To post to this group, send email to puppet...@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.
I'll admit that this is my Forge biased view of things, but I'm working towards modules that are reusable, interoperable and introspectable. It would help me contribute to the discussion if we could hammer out whether we loosely agree on the goal and definitions. I'm already pretty happy with your definition of reusable, but I'll paraphrase.Interoperable
- Module A is known to do X, Y & Z.
- Module B also does X, Y & Z and can seamlessly replace module A
Reusable
- Supports multiple operating systems with a clear & standard pattern for adding additional OSes
- General capabilities of module can be switched on or off or lightly modified. Ex., don't manage services or override configuration directory.
One way that we differ immediately on reusability is that you're pretty detailed on what you should be able to customize, like package and service names. I don't disagree with you but I'm trying to start from a higher level and see whether that's sufficient. I'm not sure what the balance is regarding # of class parameters in use / ease of use.
Introspectable
- Code follows style guide and other patterns so that contributions are more easily made and managed.
- Puppet should be able to programmatically tell us about defined class parameters and their default values. (yeah, this is theoretical atm)
Are these three goals and their values what we're all striving for with this proposal? If not, what am I missing or getting wrong?
Hey Al, sorry. I went on holiday and then had to unbury myself. I guess it's time I get my opinion out there.On Mon, Jul 1, 2013 at 2:33 AM, Alessandro Franceschi <a...@lab42.it> wrote:
On Monday, July 1, 2013 5:21:44 AM UTC+2, Ryan Coleman wrote:Hi Al, et al. I apologize for being so late to this party but I'm loving all the conversation around this. I've read through the Google Doc and found lots of cool ideas on class parameter names. Please forgive me though, my product manager wired brain wants to pause at this point and discuss it a bit first before I offer my opinions on the doc.On Tue, Jun 18, 2013 at 11:19 AM, Alessandro Franceschi <a...@lab42.it> wrote:
For me a module is reusable when:
1- It supports many different OS (this is somehow implicit and does not involve naming conventions)2- It leaves to the user freedom on how to populate and customize the provided configuration files ( I think this is the main point for most reusability cases)
3- It allows the user to manage some behaviours of the module (has a service to be restarted after a file change? Do I want to manage a service status (at runtime or boot)
4- In (somehow extreme) cases it allows the user to customize names of package/services, paths of files and so on5- It allows seamless addition of custom resources, not managed by the module but related to it6- It allows the user to decide where to place his data (also this is out of naming convention scope)
I'll admit that this is my Forge biased view of things, but I'm working towards modules that are reusable, interoperable and introspectable. It would help me contribute to the discussion if we could hammer out whether we loosely agree on the goal and definitions. I'm already pretty happy with your definition of reusable, but I'll paraphrase.Interoperable
- Module A is known to do X, Y & Z.
- Module B also does X, Y & Z and can seamlessly replace module AAgree, and to clarify this even more:
If module C needs X which is provided by module A and B:
- A and B should be seamless replaceable (as you said)
- C should allow easy selection (for the user) of another module that provides XThis second point might look redundant, given the first one, but it might be necessary since seamless replacement of modules won't be easy to achieve OR a user may want to use a module that does not support the standard namings.An approach for this second point is the usage of a dependency_class parameter (details in the Google Doc), but I'm sure the collective wisdom here may find a better solution.As in, this is the class you're expected to depend on? That's going to be a little hard to standardize on. Sometimes it's a resource you want, sometimes a fact, maybe it's multiple classes.
Also this interoperability should be somehow managed at Modulefile level (and with the puppet module command), so that I can use B even if in the Modulefile is required A.
This part, which involves changes in Puppet's code, has to be somehow addressed sooner or later, IMHO.I couldn't agree with you more here. We've got to allow for dependencies to be interchangeable and I think this is most elegantly solved (for the moment) at the module level, with its metadata and Forge ecosystem. That said, I think that's best left to another thread.
Reusable
- Supports multiple operating systems with a clear & standard pattern for adding additional OSes- General capabilities of module can be switched on or off or lightly modified. Ex., don't manage services or override configuration directory.
One way that we differ immediately on reusability is that you're pretty detailed on what you should be able to customize, like package and service names. I don't disagree with you but I'm trying to start from a higher level and see whether that's sufficient. I'm not sure what the balance is regarding # of class parameters in use / ease of use.
The idea is that you are not forced to provide all the "proposed" parameters, but if some of the parameters you provide in your module have the same function of the ones proposed, you should call them in the "standard" way.We might classify parameters in different ways, so that some should be considered somehow recommended (for a "standard module"), other optional, and other "extra" or "enhanced", because more specific and exotic (thinking about the ones related to monitoring/firewalling, for example).OK. I could get on board with that though I do think that the overall set of parameters needs to be pruned down. Which parameters could be better addressed with module/puppet changes? The dependency_class parameter mentioned above seems like a good example.
Introspectable
- Code follows style guide and other patterns so that contributions are more easily made and managed.
- Puppet should be able to programmatically tell us about defined class parameters and their default values. (yeah, this is theoretical atm)+1, but with a small note:Even if I think it can be useful to provide some recommended patterns for modules design, this is a somehow more controversial and debatable matter (as the discussion with John in this thread may suggest) so I would not couple it strictly with the discussion about naming standards which it's, imho, more easy to stage and manage.
I don't follow. Class parameters and their default values is controversial?
No problems for me in facing all the different problematics behind modules standards, but I'd suggest to make small steps and begin with the easier ones, since putting too many topics in the cauldron and keeping them tied together might make harder any improvement.
I respect that, but I think you'll agree that we may need big changes to solve some of these problems. I'm in a position to help with that, so let's strive for it!
Are these three goals and their values what we're all striving for with this proposal? If not, what am I missing or getting wrong?I think we agree on the overall goals.Actually you've added the one about introspectability that is a welcomed addition but it partly relies upon features that are still missing in Puppet.
My starting approach was to concentrate on things that can be done now, with the current Puppet versions (I'd leverage on Puppet 3, though, since we are talking about the future modules) and giving common names to common sense parameters seemed a minimal logical step.
Nevertheless, it's important to conduct this discussion in pair with the expected evolutions of Puppet, so that we can define something that makes sense now and will make sense in the future.I don't mean to beat this point to death, but I'm more interested in exploring what changes are needed to really solve the reusability goals we've discussed. I do think there's some value to having standard class parameters for module authors to align themselves around but it's not going to solve the problem IMO, it's just going to make it a little easier.That said, I would like to simultaneously collaborate on the parameter standards, with an eye towards consolidation. Would you like that feedback in your Google Doc or the new GitHub repo?
Thanks for kicking this off Al. I also care deeply about this stuff and will be trying to carve off more time each week to help you continue to explore it.Thanks to you Ryan for supporting this, PuppetLabs' influence on the matter is vital.Yeah, no problem -- this is an awesome problem to solve. I am sorry that our involvement is not as active as you'd like. We're pushing really hard over here to clear the Forge and Puppet Labs modules backlog. I can only thank you for your passion and ask for your continued patience.
--
Jakov Sosic
www.srce.unizg.hr
--
Jakov Sosic
www.srce.unizg.hr
Hi,
First off... is these some pun I'm not getting, or was it supposed to
be "Holy Grail"? Just wondering :-)
Also, when I read "Puppet Modules Standard naming conventions", I
thought it was just about module names, but it seems to be about
parameter naming inside all of the module resources.
After reading the shared Google document, I got reminded a lot of
what I've seen happen with RPM packaging over the years. Lot of
similarities, since both Puppet and RPM are tools which give a lot of
freedom in the way things get implemented.
Think of GNU/Linux distributions such as Fedora, RHEL, Mandriva, SuSE,
etc. which all use RPM packages as their building blocks : They are not
to be considered compatible for various reasons, yet they could have
been in theory.