Complete Mongrel Setup For Debian

This is a complete step-by-step configuration for using Mongrel instead of Webrick on Debian Etch. It uses the Recipes/Debian Apache2Recipe and creates a stand-alone apache server on port 8140 for puppetmaster.

You need:

  1. The mongrel and libdaemons-ruby1.8 packages from etch-backports

  2. A stand-alone apache2 configuration for puppetmaster only: Apache Configuration

  3. An init script for stand-alone apache: Apache init script

  4. A puppetmaster init script, which starts 10 mongrel processes: Puppetmasterd init script

  5. And finally, a module called puppet to tie this all together. The module’s init.pp file is listed below:

    class puppetmaster inherits apache2 {
    
      $certname = "puppet.example.com"
    
      apache2::module {
        "proxy":          ensure => present;
        "proxy_http":     ensure => present;
        "proxy_balancer": ensure => present;
        "headers":        ensure => present;
        "ssl":            ensure => present;
        "authz_host":     ensure => present;
      }
    
      file { "/etc/apache2/puppetmaster.conf":
        content => template("puppet/puppetmaster.conf"),
        require => Package["apache2"],
        notify  => Service["apache2"],
      }
    
      file { "/etc/init.d/apache2-puppetmaster":
        mode   => "755",
        source => "puppet:///puppet/apache2-puppetmaster",
        notify  => Service["apache2"],
      }
    
      file { "/etc/init.d/puppetmaster":
        mode   => "755",
        source => "puppet:///puppet/puppetmaster",
        notify  => Service["puppetmaster"],
      }
    
      package {
        "puppetmaster":       ensure => latest;
        "libldap-ruby1.8":    ensure => present;
        "rdoc":               ensure => present;
        "rails":              ensure => present;
        "libsqlite3-ruby1.8": ensure => present;
        "libdaemons-ruby1.8": ensure => present;
        "mongrel":            ensure => present;
        "cronolog":            ensure => present;
      }
    
      service { "apache2-puppetmaster":
        require => [ Package["apache2"], File["/etc/init.d/apache2-puppetmaster"], File["/etc/apache2/puppetmaster.conf"] ],
        ensure  => running,
        enable  => true,
        pattern => "apache2 -f /etc/apache2/puppetmaster.conf",
      }
    
      service { "puppetmaster":
        ensure  => running,
        enable  => true,
        require => [ Package["puppetmaster"], File["/etc/init.d/puppetmaster"] ],
      }
    
    }
    

Please send comments and bug reports for this recipe to Martha Greenberg