[Kolab-devel] Debian or Ubuntu repository

Jeroen van Meeuwen (Kolab Systems) vanmeeuwen at kolabsys.com
Wed Jun 29 10:39:37 CEST 2011


Geoff Nordli wrote:
> Hi
> 
> I am not a puppet expert by any stretch.  I would look to the puppet
> mailing list to get some feedback on what the best approach for Kolab
> packaging would be.
> 
> Drop me an email though if you need someone to help out with the testing of
> those packages.
> 

I'm a fan of letting these things evolve as they go, actually, and so attached 
is the simple class I currently use for the kolab* parts of the Roundcube 
development environment [1].

Let's note the following;

- The reference implementation is Enterprise Linux 5,

- This has originally been created for another single specific Kolab 
deployment (in terms of architecture and topology), and has since then evolved 
little by little,

- The classes included and custom types used (that are not prefixed with 
'test90-') are from puppetmanaged.org, which I own, modules are at [2] and 
documentation (insert work in progress disclaimer here) is at [3].

Kind regards,

Jeroen van Meeuwen

[1] https://wiki.kolab.org/Roundcube_Development_Environment
[2] http://git.puppetmanaged.org
[3] http://www.puppetmanaged.org/documentation/

-- 
Senior Engineer, Kolab Systems AG

e: vanmeeuwen at kolabsys.com
t: +44 144 340 9500
m: +44 74 2516 3817
w: http://www.kolabsys.com

pgp: 9342 BF08
-------------- next part --------------
class test90-kolab {
    class cyrus inherits test90-kolab {
        include test90-kolab::fqdncerts
        include test90-kolab::saslauthd

        file { "/etc/cyrus.conf":
            mode => 640,
            owner => root,
            group => mail,
            source => [
                    "puppet://$server/private/$environment/cyrus/cyrus.conf.$hostname",
                    "puppet://$server/private/$environment/cyrus/cyrus.conf"
                ],
            require => [
                    Package["cyrus-imapd"]
                ],
            notify => [
                    Service["cyrus-imapd"]
                ]
        }

        file { "/etc/imapd.annotations.conf":
            mode => 640,
            owner => "root",
            group => "mail",
            source => [
                    "puppet://$server/private/$environment/cyrus/imapd.annotations.conf"
                ],
            require => [
                    Package["cyrus-imapd"]
                ],
            notify => [
                    Service["cyrus-imapd"]
                ]
        }

        file { "/etc/imapd.conf":
            mode => 640,
            owner => "root",
            group => "mail",
            source => [
                    "puppet://$server/private/$environment/cyrus/imapd.conf.$hostname",
                    "puppet://$server/private/$environment/cyrus/imapd.conf"
                ],
            require => [
                    Package["cyrus-imapd"]
                ],
            notify => [
                    Service["cyrus-imapd"]
                ]
        }

        package { [
                "cyrus-imapd"
            ]:
            ensure => installed
        }

        service { "cyrus-imapd":
            ensure => running,
            enable => true,
            require => [
                    File["/etc/cyrus.conf"],
                    File["/etc/imapd.conf"],
                    File["/etc/imapd.annotations.conf"],
                    Package["cyrus-imapd"]
                ]
        }

        class backend inherits cyrus {
            include test90-kolab::postfix::backend

            munin::plugin { [
                    "cpuload_imapd",
                ]:
                enable => true,
                source => true,
                plugin_name => "cpuload_"
            }

            munin::plugin { [
                    "multips_memory"
                ]:
                enable => true,
                conf => "puppet://$server/private/$environment/munin/plugin-conf.d/multips_memory.backend",
                conf_name => "multips_memory"
            }

            package { [
                    "kolabd"
                ]:
                ensure => installed
            }
        }

        class frontend inherits cyrus {

            File["/etc/cyrus.conf"] {
                source => "puppet://$server/private/$environment/cyrus/cyrus.conf.frontend"
            }

            munin::plugin { [
                    "cpuload_mupdate",
                    "cpuload_proxyd"
                ]:
                enable => true,
                source => true,
                plugin_name => "cpuload_"
            }

            munin::plugin { [
                    "multips_memory"
                ]:
                enable => true,
                source => true,
                conf => "puppet://$server/private/$environment/munin/plugin-conf.d/multips_memory.frontend",
                conf_name => "multips_memory"
            }

        }

        class mupdate inherits frontend {
            File["/etc/cyrus.conf"] {
                source => "puppet://$server/private/$environment/cyrus/cyrus.conf.mupdate"
            }

            File["/etc/imapd.conf"] {
                source => "puppet://$server/private/$environment/cyrus/imapd.conf.mupdate"
            }

        }
    }

    ##
    ##
    ##
    ##
    class int-mx inherits postfix {
        File["/etc/postfix/ldap/"] {
            recurse => true,
            purge => true,
            force => true,
            source => "puppet://$server/private/$environment/postfix/ldap.int-mx/"
        }

        file { "/etc/amavisd/amavisd.conf":
            mode => 644,
            owner => "root",
            group => "root",
            source => "puppet://$server/private/$environment/amavisd/amavisd.conf",
            require => Package["amavisd-new"],
            notify => Service["amavisd"]
        }

        file { "/etc/clamd.d/amavisd.conf":
            mode => 644,
            owner => "root",
            group => "root",
            source => "puppet://$server/private/$environment/amavisd/clamd.conf",
            require => Package["clamav"],
            notify => Service["clamd.amavisd"]
        }

        file { "/var/run/clamd.amavisd/":
            ensure => directory,
            owner => "amavis",
            group => "amavis",
            mode => 750,
            require => [
                    Package["amavisd-new"],
                    Package["clamav"]
                ]
        }

        package { [
                "amavisd-new",
                "clamav"
            ]:
            ensure => installed
        }

        service { "amavisd":
            ensure => running,
            enable => true,
            require => [
                    File["/etc/amavisd/amavisd.conf"],
                    Package["amavisd-new"]
                ]
        }

        service { "clamd.amavisd":
            ensure => running,
            enable => true,
            require => [
                    File["/etc/clamd.d/amavisd.conf"],
                    File["/var/run/clamd.amavisd/"],
                    Package["clamav"]
                ]
        }

    }

    class postfix inherits test90-kolab {
        include test90-kolab::fqdncerts
        include test90-kolab::saslauthd

        file { "/etc/kolab/kolab_smtpdpolicy.conf":
            mode => 644,
            owner => "root",
            group => "kolab-n",
            source => [
                    "puppet://$server/private/$environment/kolab/kolab_smtpdpolicy.conf.$hostname",
                    "puppet://$server/private/$environment/kolab/kolab_smtpdpolicy.conf"
                ],
            require => Package["kolabd-server"],
            notify => Service["postfix"]
        }

        file { "/etc/kolab/kolabfilter.conf":
            mode => 644,
            owner => "root",
            group => "kolab-n",
            source => [
                    "puppet://$server/private/$environment/kolab/kolabfilter.conf.$hostname",
                    "puppet://$server/private/$environment/kolab/kolabfilter.conf"
                ],
            require => Package["kolabd-server"],
            notify => Service["postfix"]
        }

        file { "/etc/postfix/main.cf":
            mode => 644,
            owner => "root",
            group => "root",
            source => [
                    "puppet://$server/private/$environment/postfix/main.cf.$hostname",
                    "puppet://$server/private/$environment/postfix/main.cf"
                ],
            notify => Service["postfix"]
        }

        file { "/etc/postfix/master.cf":
            mode => 644,
            owner => "root",
            group => "root",
            source => [
                    "puppet://$server/private/$environment/postfix/master.cf.$hostname",
                    "puppet://$server/private/$environment/postfix/master.cf"
                ],
            notify => Service["postfix"]
        }

        file { "/etc/postfix/ldap/":
            owner => "root",
            group => "root",
            recurse => true,
            force => true,
            ensure => directory,
            source => [
                    "puppet://$server/private/$environment/postfix/ldap.$hostname/",
                    "puppet://$server/private/$environment/postfix/ldap/"
                ],
            notify => Service["postfix"]
        }

        munin::plugin { [
                "postfix_mailqueue",
                "postfix_mailstats",
                "postfix_mailvolume"
            ]:
            enable => true
        }

        munin::plugin { [
                "cpuload_postfix"
            ]:
            enable => true,
            plugin_name => "cpuload_",
            conf => "puppet://$server/private/$environment/munin/plugin-conf.d/cpuload_postfix",
            conf_name => "cpuload_postfix"
        }

        package { "sendmail":
            ensure => absent,
            require => Package["postfix"]
        }

        package { [
                "kolabd-server",
                "postfix"
            ]:
            ensure => installed
        }

        service { "postfix":
            ensure => running,
            enable => true,
            require => [
                    File["/etc/kolab/kolab_smtpdpolicy.conf"],
                    File["/etc/postfix/main.cf"],
                    File["/etc/postfix/master.cf"],
                    File["/etc/postfix/ldap/"],
                    Package["kolabd-server"],
                    Package["postfix"]
                ]
        }

        class backend inherits postfix {
            File["/etc/postfix/ldap/"] {
                recurse => true,
                purge => true,
                force => true,
                source => "puppet://$server/private/$environment/postfix/ldap.backend/"
            }
        }
    }

    class webserver inherits test90-kolab {
        include webserver

        include test90-munin::webserver

        file { "/etc/horde/":
            owner => "root",
            group => "apache",
            recurse => true,
            source => [
                    "puppet://$server/private/$environment/files/horde/"
                ]
        }

        file { "/etc/php.ini":
            mode => 644,
            owner => "root",
            group => "root",
            source => [
                    "puppet://$server/private/$environment/php/php.ini.$hostname",
                    "puppet://$server/private/$environment/php/php.ini"
                ],
            notify => Service["httpd"]
        }

        file { "/etc/php.d/":
            mode => 644,
            owner => "root",
            group => "root",
            recurse => true,
            purge => false,
            source => [
                    "puppet://$server/private/$environment/php/php.d.$hostname/",
                    "puppet://$server/private/$environment/php/php.d/"
                ],
            require => [
                    Package["php-pecl-apc"],
                    Package["php-pecl-memcache"]
                ],
            notify => Service["httpd"]
        }

        file { "/etc/roundcubemail/":
            owner => "root",
            group => "apache",
            recurse => true,
            purge => true,
            force => true,
            source => [
                    "puppet://$server/private/$environment/files/roundcubemail/"
                ]
        }

        package { [
                "php-pecl-apc",
                "php-pecl-memcache"
            ]:
            ensure => installed
        }

        package { [
                "kolab-fbview",
                "roundcubemail",
                "roundcubemail-kolab"
            ]:
            ensure => latest
        }

        webserver::module::enable { [
                "mod_ssl",
                "php"
            ]:
        }

        webserver::virtualhost { [
                "ko24rc06.klab.cc"
            ]:
            enable => true
        }

    }

    ##
    ## Shortcut classes to be included by other classes.
    ##

    class fqdncerts {
        file { "/etc/pki/tls/certs/kolab_ca.crt":
            mode => 644,
            owner => "root",
            group => "mail",
            source => "puppet://$server/private/$environment/files/ssl/certs/ca.crt"
        }

        file { "/etc/pki/tls/certs/$fqdn.crt":
            mode => 644,
            owner => "root",
            group => "mail",
            source => "puppet://$server/private/$environment/files/ssl/certs/$fqdn.crt"
        }

        file { "/etc/pki/tls/private/$fqdn.key":
            mode => 640,
            owner => "root",
            group => "mail",
            source => "puppet://$server/private/$environment/files/ssl/certs/$fqdn.key"
        }
    }

    class saslauthd {
        file { "/etc/saslauthd.conf":
            mode => 640,
            owner => "root",
            group => "root",
            source => [
                    "puppet://$server/private/$environment/files/saslauthd.conf.$hostname",
                    "puppet://$server/private/$environment/files/saslauthd.conf"
                ],
            require => [
                    Package["cyrus-sasl"],
                    Package["cyrus-sasl-ldap"]
                ],
            notify => Service["saslauthd"]
        }

        file { "/etc/sysconfig/saslauthd":
            mode => 640,
            owner => "root",
            group => "root",
            source => [
                    "puppet://$server/private/$environment/files/saslauthd.sysconfig.$hostname",
                    "puppet://$server/private/$environment/files/saslauthd.sysconfig"
                ],
            require => [
                    Package["cyrus-sasl"],
                    Package["cyrus-sasl-ldap"]
                ],
            notify => Service["saslauthd"]
        }

        package { [
                "cyrus-sasl",
                "cyrus-sasl-ldap"
            ]:
            ensure => installed
        }

        service { "saslauthd":
            ensure => running,
            enable => true,
            require => [
                    File["/etc/saslauthd.conf"],
                    File["/etc/sysconfig/saslauthd"],
                    Package["cyrus-sasl"],
                    Package["cyrus-sasl-ldap"]
                ]
        }

    }
}


More information about the devel mailing list