Skip to content
rhaen edited this page Feb 24, 2013 · 18 revisions

There is a desperate need for a solid class model for the perlbrew module. Here are some design ideas how things might look like. Parameters for classes/defines are written in italics.

Current status of the rewrite: Build Status

General notes

The rewrite of the module should follow the principle of KISS. If something can be set to a sane default we should keep it this way. There is no reason to have a totally overengineered module which noone understands to use and is hard to maintain. This design guide should explain the rough edges and problems. If you have remarks, annotations please use the Wiki page (Class Rewrite Annotations).

If you are not in puppet and can't imagine how this module can be used, please look at Wiki page with some suggestions for possible uses. Right now, this is a draft which is based on the classes, functions and parameters below. It's likely to change during the implementation. Have a look at the Wiki page (Usage).

For development topics check the Wiki page (Development).

The structure of the rewrite

Classes

class perlbrew::init inherits perlbrew::params

Provides basic initalization for the module

  • Installs perlbrew script
  • Installs the needed packages (build-essential, or RHEL stuff)
  • (Installs cpanminus) at a later point

class perlbrew::params

Provides the basic configuration parameters

  • $perlbrew_dest - The destination directory for perlbrew script (defaults /usr/local/bin)

Note: Choosing a user and a group might be overkill for the beginning. The daemon puppet runs the actions as root and installing binaries as user root might not be harmful. However, compiling software with an unknown stack and probably using development versions might harm your system fast. The perlbrew script will be installed as user root, group root and will be called as a user when running the perlbrew::build function. --rhaen

Defines

define perlbrew::build import perlbrew::params

Builds the Perl interpreter of your choice

  • $perlbrew_root - The root where the perls will be installed (will be created if needed)
  • $perlbrew_owner - owner/user which will own the files
  • $perlbrew_group - group which will own the files
  • $version - The version of the interpreter which should be built

( $perlbrew_root - will be imported from perlbrew::params )

define perlbrew::module import perlbrew::params

Installs a CPAN module using cpanminus

  • $module - The name of the module which should be installed