Hello.
  I recently tried to improve a module I have which is used to create
one or more instances of mysql per node.  The original module had
lot's of code repetition to get around gaps in my skills.   The new
improved module has less code repetition but doesn't seem as clean as
I imagined it in my head:)

  The env is puppet 2.6.4, facter 1.5.8, solaris 10 x86 and nodes.pp
files not external nodes.

   I still find myself thinking shell scripting and not managed
resources.   So while the module does what I want it to I would
appreciate any feedback to help me stay in line with good practices
and approaching the problem in a more puppet like fashion.

   I put the module at https://github.com/someword/mysql-module and
included an example-nodes.pp file in the top level which illustrates
what a node would look like.

   The three key areas where I feel could be improved are:

1.  In the mysql::instance define the use of an "if/elsif/else" clause
to decide which version class to load to get the particular variables
for that version.
    When i used the notation
    include "mysql::$major"

    the right class got included but the variables set in their were
not readily available for use in the mysql::instance define.   Also I
tried calling mysql::$major { "$instance": } but that failed syntax
checking.

2.  It's possible for 2 mysql instances on one node to use the same
version of software which causes duplicate resources.  To get around
this I used an if statement in the package.pp manifest to check if the
resource is defined so that it wouldn't get duplicated.  Having to
take this step makes me think I'm not doing something correctly.

3.  Resource ordering.
  I rely on alot of resource ordering to ensure the correct
application of resources.  I'm wondering if their are cleaner/better
approaches to ensure the desired ordering with out explicitly stating
them.

  Any input to help broaden my puppet horizons is welcome.
  TIA.  deet.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to