Hello folks, At Stanford, we use modules to define every possible service, package, feature in the traditional sense (apache, ntp, iptables, etc). Then, for clients (such as other departments) and "services" (such as our mailman infrastructure, our ldap infrastructure, etc), we use manifests in /master/manifests and distributable files in /dist/ and templates in /master/templates. So, I''m looking at this and thinking, why not take advantage of the encapsulation provided by modules for all of that. So, we''re thinking of doing that and having 3 module paths and then basically having a site.pp and a nodes.pp and pretty much everything else be modules. Does that sound crazy?
On Tue, Aug 07, 2007 at 05:16:53PM -0700, Digant C Kasundra wrote:> So, I''m looking at this and thinking, why not take advantage of the > encapsulation provided by modules for all of that. So, we''re thinking of > doing that and having 3 module paths and then basically having a site.pp > and a nodes.pp and pretty much everything else be modules. > > Does that sound crazy?Nope, I''m planning on going all-modules, all-the-time, at some stage in the future. Helps keep all the files related to one logical aspect together, and makes it a lot easier to share the manifests for a particular service. - Matt -- "I''m tempted to try Gentoo, but then I learned that its installer is in Python, and, well, a base Python install on my system is something like fifty megabytes (for what? oh, right, we NEED four XML libraries, I forgot)." -- Dave Brown, ASR
On Aug 7, 2007, at 7:16 PM, Digant C Kasundra wrote:> > So, I''m looking at this and thinking, why not take advantage of the > encapsulation provided by modules for all of that. So, we''re > thinking of > doing that and having 3 module paths and then basically having a > site.pp > and a nodes.pp and pretty much everything else be modules. > > Does that sound crazy?Not at all. My only question is, why the site.pp and nodes.pp? :) Of course, I know the answer, today, is that they''re required, but if you have an external node source, then it seems like they both basically go away. All of your functional content is in modules, your node/class association is in your node tool, and you''re done. This is definitely my target. -- A censor is a man who knows more than he thinks you ought to. -- Granville Hicks --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
On Tue, 2007-08-07 at 17:16 -0700, Digant C Kasundra wrote:> So, I''m looking at this and thinking, why not take advantage of the > encapsulation provided by modules for all of that. So, we''re thinking of > doing that and having 3 module paths and then basically having a site.pp > and a nodes.pp and pretty much everything else be modules. > > Does that sound crazy?I think that sounds decidedly uncrazy - I''ve been thinking lately that we could push modules even further by letting them also define functions and custom types. But that''s just a Great Idea (tm) so far David
On Wed, Aug 08, 2007 at 09:47:59AM +0100, David Lutterkort wrote:> On Tue, 2007-08-07 at 17:16 -0700, Digant C Kasundra wrote: > > So, I''m looking at this and thinking, why not take advantage of the > > encapsulation provided by modules for all of that. So, we''re thinking of > > doing that and having 3 module paths and then basically having a site.pp > > and a nodes.pp and pretty much everything else be modules. > > > > Does that sound crazy? > > I think that sounds decidedly uncrazy - I''ve been thinking lately that > we could push modules even further by letting them also define functions > and custom types. But that''s just a Great Idea (tm) so farI thought you already could load custom types from a module. If you can''t, that''s definitely something that we''d want to change. My vision for modules is that *everything* will one day be shipped in them, and that''s all we''ll deal with. - Matt
On Aug 8, 2007, at 4:58 AM, Matt Palmer wrote:> I thought you already could load custom types from a module. If > you can''t, > that''s definitely something that we''d want to change. My vision > for modules > is that *everything* will one day be shipped in them, and that''s > all we''ll > deal with.I agree. This will be a tad complicated, as we''ll need a single sync statement on the client to translate to many locations on the server (e.g., the client asks for /plugins/ and the server searches through all of the different modules and pulls the results into the /plugins/ dir). The server will also need to add each module''s lib dir to its search path, so it can see those types for validation and the functions for usage during compilation. I''m not specifically advocating either of these solutions, just saying that something like them will need to be done to make this work in a reasonable way. -- The most incomprehensible thing about the world is that it is at all comprehensible. --Albert Einstein --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Wednesday 08 August 2007, Luke Kanies wrote:> On Aug 8, 2007, at 4:58 AM, Matt Palmer wrote: > > I thought you already could load custom types from a module. If > > you can''t, > > that''s definitely something that we''d want to change. My vision > > for modules > > is that *everything* will one day be shipped in them, and that''s > > all we''ll > > deal with. > > I agree. This will be a tad complicated, as we''ll need a single sync > statement on the client to translate to many locations on the server > (e.g., the client asks for /plugins/ and the server searches through > all of the different modules and pulls the results into the /plugins/ > dir). > > The server will also need to add each module''s lib dir to its search > path, so it can see those types for validation and the functions for > usage during compilation. > > I''m not specifically advocating either of these solutions, just > saying that something like them will need to be done to make this > work in a reasonable way.A first step would be to automatically wrap everything contained in a module into a namespace of the same name as the module''s name. This way all references from the outside can use appropriate autoload mechanisms. e.g. for the module "ntp": templates: "ntp/ntpd.erb" -> $modulepath/ntp/templates/ntpd.conf functions: ntp::munge($var) -> $modulepath/ntp/puppet/parser/functions/munge.rb facts: These have to be pulled to the client before requesting a configuration $ntp::stratum -> puppet://$servername/facter/ntp/stratum.rb -> $modulepath/ntp/facter/stratum.rb resource types: these are needed on the client to validate the downloaded configuration ntp::config{...} -> puppet://$servername/type/ntp/config.rb -> $modulepath/ntp/puppet/type/config.rb providers: these are needed on the client to validate the downloaded configuration user { ntp: provider => smbldap::user, ...} -> puppet://$servername/provider/smbldap/user.rb -> $modulepath/smbldap/puppet/provider/user.rb files: "ntp/ntpd.conf" -> puppet://$servername/ntp/ntpd.conf -> $modulepath/ntp/files/ntpd.conf other classes and defines: include ntp::client ntp::server { ... } -> $modulepath/ntp/manifests/init.pp Regards, David - -- The primary freedom of open source is not the freedom from cost, but the free- dom to shape software to do what you want. This freedom is /never/ exercised without cost, but is available /at all/ only by accepting the very different costs associated with open source, costs not in money, but in time and effort. - -- http://www.schierer.org/~luke/log/20070710-1129/on-forks-and-forking -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFGuf10/Pp1N6Uzh0URAvnWAJ9WxxvWJvusH+Bf08n8qRcs8VcG6wCZATt5 fvx7NzN3KTBtFG1FoODJmYU=94tL -----END PGP SIGNATURE-----
On Aug 8, 2007, at 12:29 PM, David Schmitt wrote:> A first step would be to automatically wrap everything contained in > a module > into a namespace of the same name as the module''s name. This way all > references from the outside can use appropriate autoload mechanisms.This is already done with the three filetypes supported by modules (files, templates, and manifests). -- I do not feel obliged to believe that the same God who has endowed us with sense, reason, and intellect has intended us to forgo their use. -- Galileo Galilei --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
I''ve been thinking about the module sets and the +> concept and I have a question. If someone wants to set up something, like an http allow list, where a bunch of modules need different pieces added, how can they do this? Wow, bad grammar.... Example: Module A - Apache - Allow local Module B - Web site X - Allow blah.com So, my allow list should be Allow local Allow blah.com Or Allow local blah.com This is a contrived example, and I know that I could use wildcards, but imagine that I don''t want to and I want to use a template that gets implemented at the end to collapse all of these rules together. Another way of looking at this is how you modify parts of the same file with different modules in an elegant manner. Thanks, Trevor On 8/8/07, Luke Kanies <luke@madstop.com> wrote:> On Aug 8, 2007, at 12:29 PM, David Schmitt wrote: > > > A first step would be to automatically wrap everything contained in > > a module > > into a namespace of the same name as the module''s name. This way all > > references from the outside can use appropriate autoload mechanisms. > > This is already done with the three filetypes supported by modules > (files, templates, and manifests). > > -- > I do not feel obliged to believe that the same God who has endowed us > with sense, reason, and intellect has intended us to forgo their use. > -- Galileo Galilei > --------------------------------------------------------------------- > Luke Kanies | http://reductivelabs.com | http://madstop.com > > > _______________________________________________ > Puppet-users mailing list > Puppet-users@madstop.com > https://mail.madstop.com/mailman/listinfo/puppet-users >
On Aug 9, 2007, at 10:49 AM, Trevor Vaughan wrote:> This is a contrived example, and I know that I could use wildcards, > but imagine that I don''t want to and I want to use a template that > gets implemented at the end to collapse all of these rules together. > > Another way of looking at this is how you modify parts of the same > file with different modules in an elegant manner.You should be able to do this pretty easily using ''+>'', as long as you''re not concerned about order. You''ll have to create a resource type that has an attribute that covers that functionality, but once it''s there (and handles arrays) it should be easy to get what you want. -- I have learned to use the word ''impossible'' with the greatest caution. -- Wernher von Braun --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com