El miércoles, 25 de septiembre de 2013 00:53:59 UTC-3, egeland escribió:I for one think this is a great approach. Hopefully, Dolf agrees. :)Should the all-in-one collection be based off the nextgen repo, maybe?Or start from scratch?
I would start from nexgen modules. There are a lot of hours in coding in there that would be a pitty to throw away starting from scratch, don't you agree? :)Happy to help where I can.
I think there's also a lot of room for improvement in the existing modules arising from the POV of someone who is testing and integrating them as an interdependent set. Thinking off the top of my head:
- Reviewing / extending / rewriting the documentation: many modules have undocumented features that I found only reading the code. That even happens with the modules I've written, as sometimes I don' t know how to explain things clearly and feel that the documentation I write is kind of poor :|
- Reviewing / extending / adding rspec tests for the modules. Many modules have defines or classes that are simply not being tested, or existing tests don't cover some use cases that you might need. Al have stated that he wanted to improve these testings, and in the process of integrating the ex42mods in a single "all-the-modules-you-might-want" repo (we need a name here :D) these tests will be a "must have", just to keep everything working OK.
- Request for features: particularly those related to interdependency.
- Submit patches? :)
Any other ideas?
file (file_path? config_file? config?) (1)
file_source (source? config_file_source? config_source?)
file_template (template? config_file_template? config_template?...)
On 10/02/2013 04:58 AM, Alessandro Franceschi wrote:Guys,some kind of feedback here is definitively welcomed.Before starting to rollout new "stdmod" modules there are some points to define, both about naming (on which I don't want to be the only decision-maker) and about approach.The params naming as in https://github.com/stdmod/puppet-modules/blob/master/Parameters_List.md is almost defined, but there are still 2 key decisions to make:1- Name of the parameter that maps to the namevar: For example: package vs package_name, file vs file_path, service vs service_name. The are reasons for both the alternatives, currently PuppetLabs modules tend to follow the "package_name" alternative, while Example42's NextGen ones the "package" one.2- Name of the main configuration file managed by a class: file (currently used is stdmod sample modules) vs config_file (currently used in Ex42 NextGen) vs config3- Name of the parameter that refers to template or source to use for the main configuration file: file_template (currently used is stdmod sample modules) vs template (currently used in Ex42 NextGen) vs config_file_template vs config_template (same for source)Decision of these names is important both for the whole coherency of the naming standards and for the possibility to start to work on the new modules, it's a required prerequisite.
Sent you a PR with some ideas.
> Another point is about the opportunity to consider to use some of PuppetLabs
> modules for some core applications: for example apache, mysql, postgresql,
> firewall. Both because they are quite good and complete and because they are
> widely used and their adoption directly in the stdmod set would reduce many
> incompatibility issues. The downside here is that they are not (still?)
> fully stdmod compliant, but I suppose that can be worked on with time,
> proposing PR to the core maintainers. The same approach could be done for
> other largely used and recognized modules from other authors: key points here
> are better interoperability and more code reuse, at eventually the cost of
> the general coherency of the modules set. What do you think about this?
I use a couple of modules from puppetlabs, but others I found better to rewrite
them using their logic but following ex42 modules structure. Haven't tried
particularly those that you propose, but I think it would be easier to:
1. Write a ex42 scaffold
2. Add code following already existing modules (even using c&p and giving
attribution where needed?)
This approach would give us more coherence, but will be more work. Really
don't have a defined preference here, so it's possible you can make me change my
mind easily :)
> Another point is about the opportunity to consider to use some of PuppetLabs modules for some core applications: for example apache, mysql, postgresql, firewall. Both because they are quite good and complete and because they are widely used and their adoption directly in the stdmod set would reduce many incompatibility issues.
> The downside here is that they are not (still?) fully stdmod compliant, but I suppose that can be worked on with time, proposing PR to the core maintainers.
> The same approach could be done for other largely used and recognized modules from other authors: key points here are better interoperability and more code reuse, at eventually the cost of the general coherency of the modules set.
> What do you think about this?
> Opinions definitively welcomed.
Another issue I came across these days:
https://github.com/puppetlabs/puppetlabs-haproxy/pull/52#issuecomment-25638694
---
While I appreciate this we don't plan to extend support of haproxy to 2.6, which
is long past EOL. I'm afraid I'm going to reject this one.
---
So we probably should also consider dropping 2.6 support on ex42 modules (ie.
removing it from tests, travis, etc.?)
There's also another issue that I would propose to consider in the new modules structure:
- Adding a "/doc(s)" subdirectory in the module structure, where we put all that documentation that we are keeping currently at the top of each recipe.
- Trim down all the documentation at the top of each recipe to a ONE-LINER (two lines tops) explaining briefly the parameter options.
Much of the headers, nowadays, are repeated from module to module, with changes that were added to a module's file but not passed to another module, leading to inconsistencies of documentation between them
Keeping the "general modules' parameters documentation" in a separate file can help, ie., for an author to pull changes for these particular files under the "/doc(s)" dir, diff them against her module's copy of them and merge/modify/update them.
Also, it will make easier to add examples where needed or extend the documentation as desired by the module's author.
What do you think?
Hi,Thanks for splitting the thread.I agree with the principles you've outlined in your email in general. They seem very reasonable to me.Some remarks though:> 0- No NextGen legaciesIt seems a very noble goal, and will be doable in a lot of places. However, should we also apply this to modules that are really commonly used as dependencies? The example42/puppet-firewall module coms to mind. If we were to break BC there, one couldn't use both Example42 as well as StdMod modules. Forcing people to stick with Example42 modules, or forcing us to ensure we port it all to StdMod.
> 1- Real single point of responsability for modules> It might even have something like apache::passenger, with its own parameters, but is should not expose any passenger related parameter in the main class.This seems a little contradictory to me? I'd say that we should strive for a single point of responsibility for _classes_. This means that for Apache, we could have these classes:- apache: Manages Apache itself (some config stuff only, perhaps monitoring of the Apache instance)- apache::install: Manages installation of Apache. This may be a bit overabundant for an application that can be installed by just 1 package statement, but some stuff needs compilation, etc. And it's easy for people to override.- apache::repo: Manages the application repo for Apache- apache::vhost: Configures a vhost, adds the relevant monitoring and firewall rules (proxies it to $monitor_class, $firewall_class)- apache::module::passenger: Does the Passenger stuff
> $monitor_class - The name of the class to use to manage monitoring.> $monitor_config_hash - An open to any option configuration hash (we may stanrdardize it when working on the new monitor / firewall implementations ). Same for $firewall_Out of curiosity, how would you include a defined type ($monitor_class should probably be $monitor_type instead?) based on a config hash?
if $openssh::monitor_class {class { $openssh::monitor_class: config_hash => $monitor_config_hash, scope_hash => inline_template('<%= scope.to_hash.reject { |k,v| k.to_s =~ /(uptime.*|path|timestamp|free|.*password.*|.*psk.*|.*key)/ } %>'), }}
> 2- Higher abstraction stack modulesI like the idea. Question is though if we should put all the stacks we have in 1 repo, or should we use 1 repo per stack? Assuming you've given this some thought, what are your considerations? I don't use the module system from the forge myself, but if we put it all in 1 module, we can't use the Modulefiles here to manage dependencies.
As a sidenote, all stacks we do provide should provide means to set up distributedly. A LAMP stack is fun on one device, but it should provide the ability to setup Apache+PHP on one node, and MariaDb on another node (perhaps automatically configuring fw rules etc in the mean time?). Another example is the logs stack (which I wasn't aware of); it should be able to run rabbitmq on one node, elastic search on another (cluster of) node(s), etc.
$puppet_install = true,$puppetdb_install = false,$postgresql_install = false,
$puppet_config_template = 'stack_puppet/puppet/puppet.conf',$puppet_options_hash = { },
$activemq_servers = query_nodes('Class[activemq]')$activemq_servers_ip = query_nodes('Class[activemq', ipaddress)$puppetmaster_servers = query_nodes('Class[puppet::server]')$puppetmaster_servers_ip = query_nodes('Class[puppet::server]', ipaddress)
> 3. Naming conventionsIt was mentioned somewhere in this thread; I think we should strive to adhere to the same conventions as PuppetLabs does. Consistency can only benefit the Puppet ecosystem as a whole. Of course we can deviate from specific points, but that should be accompanied with some good argumentation, not just personal preference.
> 4- Distributed development (modules mantainers)[...]Agreed. Though I do like the thought of Al fixing all my fuckups :D (no worries, just kidding).A factor that comes to mind here though is the distros and OS's we want to support. I myself usually use Ubuntu, and I think it's tough to expect to expect each contributor to be able to support Solaris through BSD through Linux (with who knows how many distros) through Windows (what versions?). I think we should define some versions and distro's we'd like to support (CentOS 6, Ubuntu 12.04) in all modules, and that all contributors should try to support at least those two. That can then be accompanied by some Rspec tests (should those be mandatory?), and we could configure Travis to test on all the OS's we try to support(? - I don't really know Travis).
Furthermore Al, I believe you have some Vagrant boxes that you use to test stuff on, assuming you've accumulated some best practices with those, could you perhaps share those? That would allow people to more easily test a variety of distro's.
Reason for putting the version stuff under 'distributed maintainers' is that many developers base their work off of 1 distro only, but we could just as well make it a separate principle of StdMod.
> Code can stay in each mantainer's reposWhat do you mean by this point? I'd personally like to have the upstream module reside under the StdMod organization for multiple reasons:- People know where to file a PR under: That of the StdMod organization.- There's a shared sense of ownership. Even though each module has its own maintainer, maintainers can be busy, on holidays, or otherwise (temporarily) awol. Other contributors should feel free to work on a module, even though they are not responsible for maintaining it.- I've noticed that search engines tend to show up the original (parent) repo only in their results. SEO-wise it helps to host the original repos. When people see 'StdMod they'll hopefully use it more quicker than each contributor's individual name. Given that StdMod as a collection will be faster establishing a recognized brand.- I like to mess with my own repos, without messing with any of the official ones.
Along those lines, I think it'd be good if all code that goes into any of the StdMod repo's is peer reviewed (by filing a PR). Not because I don't trust other contributors, but because two pair of eyes simply catch more than one pair of eyes.
> 5- Implementation and usage patterns coherencyAgreed. I'd propose to have a base module that we can derive all other modules from. I know it's already there, but what I'd like to stress is the importance of having a single template only. With Example42 there are multiple templates, and I've seen that lead to inconsitencies, because different people used different templates (within the previous company I worked at).
Thoughts?
Hi Al,I think for the biggest part we agree. Some minor things though;> Well here we have to consider 2 cases:
> - modules based on stdmod naming standards (the can support whatever the author wants)
>- "official" stdmod modules (if we will ever have them), in these case they should adhere to some minimal requirements, about OS support minimal params (like the ones about monitoring etc) and so on.I'd prefer to only have "official" stdmod modules in the StdMod organizations. Meaning that people should be able to simply pick a module from the StdMod organization, and know what support and level of quality they can expect. As part of that coherency. Maybe that's what you already meant, but I'd like to make sure ;)
> My idea is: $monitor_class is the name of the class to use (ie: example42::monitor::apache
> and $monitor_config_hash is an hash where you can place whatever data that the module has to consume.I've replied to this separately on the Puppet Users Google Groups list.>> Along those lines, I think it'd be good if all code that goes into any of the StdMod repo's is peer reviewed (by filing a PR). Not because I don't trust other contributors, but because two pair of eyes simply catch more than one pair of eyes.
> Sure. This actually can apply mostly in the second case.What second case are you referring to? I think that it'd be good that for all code merged into any repo in the StdMod a Pull Request would be the preferred way.> The internal structure of the modules (at least teh "official" stdmod ones should be coherent, but thi doesn't mean having just one template to use as "golden image". I'd rather make different templates for different kind of modules.
> - A template for the standard package/service/config file module
> - A template for a simpler package/config module
> - A template for multiple services/packages applications
> - A template for java applications and so onThe problem I foresee with a distinction based on the 'standard' v. 'simpler' module is that simple modules will eventually grow, and become extra-large. That's not a problem, but it will cause people to deviate from the standard. I'm all for making specific modules, but only for specific use cases. As such, I can imagine having a 'default' template, and a 'stack' module for example. But things based on size, simplicity, or the fact that they are published on the forge I really would like to recommend against.
Nonetheless, I'm happy to conclude that for 9 out of 10 points we seem to be on the same line.