[prev in list] [next in list] [prev in thread] [next in thread] 

List:       puppet-users
Subject:    Re: [Puppet-users] class imports?
From:       Luke Kanies <luke () madstop ! com>
Date:       2007-03-28 22:28:57
Message-ID: E3533E9F-EA5F-44E4-8062-0DFFE0211557 () madstop ! com
[Download RAW message or body]

On Mar 28, 2007, at 5:05 PM, Atom Powers wrote:
>
> What is the "correct" way to do this?
> I could start each of those files with "class blah-blah {" and end it
> with an friendly "}"; but that pushes the logic out to each individual
> file, and I would really rather keep it centralized.

The correct way is to put all of the code in the classes, each class  
in the appriately named file, and then import all of the files.   
E.g., the 'mysql' class would be defined in the 'mysql.pp' file.

Really, unless you're using modules I recommend putting these all  
into a classes/ subdirectory, and then just doing 'import "classes/ 
*"' or something similar.

But the key point is to put the code for that class within the class  
definition, rather than unencapsulated in a file.

  --
  To succeed in the world it is not enough to be stupid, you must  
also be
  well-mannered.      -- Voltaire
  ---------------------------------------------------------------------
  Luke Kanies | http://reductivelabs.com | http://madstop.com



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic