Faidon Liambotis has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/185404

Change subject: mailman: move into a new, separate module
......................................................................

mailman: move into a new, separate module

Move all the mailman manifests & files into a separate module. This is
fairly Wikimedia-specific by design. There are some grey lines between
this and the role class that could probably be improved in a later
patchset.

Change-Id: I38660ba8533c47caf823a77890dc66b38c870957
---
M manifests/mail.pp
M manifests/role/mail.pp
R modules/mailman/files/docroot/favicon.ico
R modules/mailman/files/docroot/favicon.png
A modules/mailman/files/docroot/index.html
R modules/mailman/files/docroot/robots.txt
R modules/mailman/files/mm_cfg.py
R modules/mailman/files/templates/ar/listinfo.html
R modules/mailman/files/templates/ca/listinfo.html
R modules/mailman/files/templates/cs/listinfo.html
R modules/mailman/files/templates/de/listinfo.html
R modules/mailman/files/templates/en/listinfo.html
R modules/mailman/files/templates/es/listinfo.html
R modules/mailman/files/templates/fa/listinfo.html
R modules/mailman/files/templates/fi/listinfo.html
R modules/mailman/files/templates/fr/listinfo.html
R modules/mailman/files/templates/hi/listinfo.html
R modules/mailman/files/templates/hr/listinfo.html
R modules/mailman/files/templates/hu/listinfo.html
R modules/mailman/files/templates/id/listinfo.html
R modules/mailman/files/templates/it/listinfo.html
R modules/mailman/files/templates/ko/listinfo.html
R modules/mailman/files/templates/lt/listinfo.html
R modules/mailman/files/templates/nl/listinfo.html
R modules/mailman/files/templates/no/listinfo.html
R modules/mailman/files/templates/pl/listinfo.html
R modules/mailman/files/templates/pt/listinfo.html
R modules/mailman/files/templates/pt_BR/listinfo.html
R modules/mailman/files/templates/ru/listinfo.html
R modules/mailman/files/templates/sk/listinfo.html
R modules/mailman/files/templates/sv/listinfo.html
R modules/mailman/files/templates/ta/listinfo.html
R modules/mailman/files/templates/uk/listinfo.html
R modules/mailman/files/templates/vi/listinfo.html
R modules/mailman/files/templates/zh/listinfo.html
A modules/mailman/manifests/init.pp
A modules/mailman/manifests/listserve.pp
A modules/mailman/manifests/webui.pp
R modules/mailman/templates/lists.wikimedia.org.erb
39 files changed, 103 insertions(+), 121 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/04/185404/1

diff --git a/manifests/mail.pp b/manifests/mail.pp
index 31d88c3..22957e4 100644
--- a/manifests/mail.pp
+++ b/manifests/mail.pp
@@ -135,124 +135,3 @@
         }
     }
 }
-
-class mailman {
-    class listserve {
-        package { 'mailman':
-            ensure => present,
-        }
-
-        system::role { 'mailman::listserve':
-            description => 'Mailman listserver',
-        }
-
-        file { '/etc/mailman/mm_cfg.py':
-            owner  => 'root',
-            group  => 'root',
-            mode   => '0444',
-            source => 'puppet:///files/mailman/mm_cfg.py',
-        }
-
-        # Install as many languages as possible
-        include locales::extended
-
-        debconf::set { 'mailman/gate_news':
-            value  => 'false',
-            notify => Exec['dpkg-reconfigure mailman'],
-        }
-
-        debconf::set { 'mailman/site_languages':
-            value  => 'ar, ast, ca, cs, da, de, en, es, et, eu, fi, fr, gl, 
he, hr, hu, ia, it, ja, ko, lt, nl, no, pl, pt, pt_BR, ro, ru, sk, sl, sr, sv, 
tr, uk, vi, zh_CN, zh_TW',
-            notify => Exec['dpkg-reconfigure mailman'],
-        }
-
-        debconf::set { 'mailman/default_server_language':
-            value  => 'en',
-            notify => Exec['dpkg-reconfigure mailman'],
-        }
-
-        exec { 'dpkg-reconfigure mailman':
-            require     => Class['locales::extended'],
-            before      => Service['mailman'],
-            command     => '/usr/sbin/dpkg-reconfigure -fnoninteractive 
mailman',
-            refreshonly => true
-        }
-
-        service { 'mailman':
-            ensure    => running,
-            hasstatus => false,
-            pattern   => 'mailmanctl',
-        }
-
-    }
-
-    class web-ui {
-        include ::apache
-        apache::mod_conf { [
-            'ssl',
-            'headers',
-            'rewrite',
-            'alias',
-            'setenvif',
-            'auth_digest',
-        ]: }
-
-        if ( $::realm == 'production' ) {
-            install_certificate{ 'lists.wikimedia.org':
-                ca => 'RapidSSL_CA.pem',
-            }
-        }
-
-        # htdigest file for private list archives
-        file { '/etc/apache2/arbcom-l.htdigest':
-            source  => 'puppet:///private/mailman/arbcom-l.htdigest',
-            owner   => 'root',
-            group   => 'www-data',
-            mode    => '0440',
-            require => Class['apache'],
-        }
-
-        $ssl_settings = ssl_ciphersuite('apache-2.2', 'compat', '365')
-
-        apache::site { 'lists.wikimedia.org':
-            content => template('apache/sites/lists.wikimedia.org.erb'),
-        }
-
-        # Add files in /var/www (docroot)
-        file { '/var/www':
-            source  => 'puppet:///files/mailman/docroot/',
-            owner   => 'root',
-            group   => 'root',
-            mode    => '0444',
-            recurse => 'remote',
-        }
-
-        # Add a new default theme to make mailman prettier
-        file { '/var/lib/mailman/templates':
-            ensure  => link,
-            target  => '/etc/mailman',
-        }
-
-        # Add default theme to make mailman prettier.
-        #  Recurse => remote adds a bunch of files here and there
-        #  while leaving the by-hand mailman config files in place.
-        file { '/etc/mailman':
-            source  => 'puppet:///files/mailman/templates/',
-            owner   => 'root',
-            group   => 'root',
-            mode    => '0444',
-            recurse => 'remote',
-        }
-
-        # monitor SSL cert expiry
-        if ( $::realm == 'production' ) {
-            monitoring::service { 'https':
-                description   => 'HTTPS',
-                check_command => 'check_ssl_http!lists.wikimedia.org',
-            }
-        }
-    }
-
-    include listserve
-    include web-ui
-}
diff --git a/manifests/role/mail.pp b/manifests/role/mail.pp
index 06ec7d5..958fdc9 100644
--- a/manifests/role/mail.pp
+++ b/manifests/role/mail.pp
@@ -147,6 +147,11 @@
         check_command => 'check_smtp',
     }
 
+    monitoring::service { 'https':
+        description   => 'HTTPS',
+        check_command => 'check_ssl_http!lists.wikimedia.org',
+    }
+
     nrpe::monitor_service { 'procs_mailmanctl':
         description  => 'mailman_ctl',
         nrpe_command => '/usr/lib/nagios/plugins/check_procs -c 1:1 -u list 
--ereg-argument-array=\'/mailman/bin/mailmanctl\''
diff --git a/files/mailman/docroot/favicon.ico 
b/modules/mailman/files/docroot/favicon.ico
similarity index 100%
rename from files/mailman/docroot/favicon.ico
rename to modules/mailman/files/docroot/favicon.ico
Binary files differ
diff --git a/files/mailman/docroot/favicon.png 
b/modules/mailman/files/docroot/favicon.png
similarity index 100%
rename from files/mailman/docroot/favicon.png
rename to modules/mailman/files/docroot/favicon.png
Binary files differ
diff --git a/modules/mailman/files/docroot/index.html 
b/modules/mailman/files/docroot/index.html
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/modules/mailman/files/docroot/index.html
diff --git a/files/mailman/docroot/robots.txt 
b/modules/mailman/files/docroot/robots.txt
similarity index 100%
rename from files/mailman/docroot/robots.txt
rename to modules/mailman/files/docroot/robots.txt
diff --git a/files/mailman/mm_cfg.py b/modules/mailman/files/mm_cfg.py
similarity index 100%
rename from files/mailman/mm_cfg.py
rename to modules/mailman/files/mm_cfg.py
diff --git a/files/mailman/templates/ar/listinfo.html 
b/modules/mailman/files/templates/ar/listinfo.html
similarity index 100%
rename from files/mailman/templates/ar/listinfo.html
rename to modules/mailman/files/templates/ar/listinfo.html
diff --git a/files/mailman/templates/ca/listinfo.html 
b/modules/mailman/files/templates/ca/listinfo.html
similarity index 100%
rename from files/mailman/templates/ca/listinfo.html
rename to modules/mailman/files/templates/ca/listinfo.html
diff --git a/files/mailman/templates/cs/listinfo.html 
b/modules/mailman/files/templates/cs/listinfo.html
similarity index 100%
rename from files/mailman/templates/cs/listinfo.html
rename to modules/mailman/files/templates/cs/listinfo.html
diff --git a/files/mailman/templates/de/listinfo.html 
b/modules/mailman/files/templates/de/listinfo.html
similarity index 100%
rename from files/mailman/templates/de/listinfo.html
rename to modules/mailman/files/templates/de/listinfo.html
diff --git a/files/mailman/templates/en/listinfo.html 
b/modules/mailman/files/templates/en/listinfo.html
similarity index 100%
rename from files/mailman/templates/en/listinfo.html
rename to modules/mailman/files/templates/en/listinfo.html
diff --git a/files/mailman/templates/es/listinfo.html 
b/modules/mailman/files/templates/es/listinfo.html
similarity index 100%
rename from files/mailman/templates/es/listinfo.html
rename to modules/mailman/files/templates/es/listinfo.html
diff --git a/files/mailman/templates/fa/listinfo.html 
b/modules/mailman/files/templates/fa/listinfo.html
similarity index 100%
rename from files/mailman/templates/fa/listinfo.html
rename to modules/mailman/files/templates/fa/listinfo.html
diff --git a/files/mailman/templates/fi/listinfo.html 
b/modules/mailman/files/templates/fi/listinfo.html
similarity index 100%
rename from files/mailman/templates/fi/listinfo.html
rename to modules/mailman/files/templates/fi/listinfo.html
diff --git a/files/mailman/templates/fr/listinfo.html 
b/modules/mailman/files/templates/fr/listinfo.html
similarity index 100%
rename from files/mailman/templates/fr/listinfo.html
rename to modules/mailman/files/templates/fr/listinfo.html
diff --git a/files/mailman/templates/hi/listinfo.html 
b/modules/mailman/files/templates/hi/listinfo.html
similarity index 100%
rename from files/mailman/templates/hi/listinfo.html
rename to modules/mailman/files/templates/hi/listinfo.html
diff --git a/files/mailman/templates/hr/listinfo.html 
b/modules/mailman/files/templates/hr/listinfo.html
similarity index 100%
rename from files/mailman/templates/hr/listinfo.html
rename to modules/mailman/files/templates/hr/listinfo.html
diff --git a/files/mailman/templates/hu/listinfo.html 
b/modules/mailman/files/templates/hu/listinfo.html
similarity index 100%
rename from files/mailman/templates/hu/listinfo.html
rename to modules/mailman/files/templates/hu/listinfo.html
diff --git a/files/mailman/templates/id/listinfo.html 
b/modules/mailman/files/templates/id/listinfo.html
similarity index 100%
rename from files/mailman/templates/id/listinfo.html
rename to modules/mailman/files/templates/id/listinfo.html
diff --git a/files/mailman/templates/it/listinfo.html 
b/modules/mailman/files/templates/it/listinfo.html
similarity index 100%
rename from files/mailman/templates/it/listinfo.html
rename to modules/mailman/files/templates/it/listinfo.html
diff --git a/files/mailman/templates/ko/listinfo.html 
b/modules/mailman/files/templates/ko/listinfo.html
similarity index 100%
rename from files/mailman/templates/ko/listinfo.html
rename to modules/mailman/files/templates/ko/listinfo.html
diff --git a/files/mailman/templates/lt/listinfo.html 
b/modules/mailman/files/templates/lt/listinfo.html
similarity index 100%
rename from files/mailman/templates/lt/listinfo.html
rename to modules/mailman/files/templates/lt/listinfo.html
diff --git a/files/mailman/templates/nl/listinfo.html 
b/modules/mailman/files/templates/nl/listinfo.html
similarity index 100%
rename from files/mailman/templates/nl/listinfo.html
rename to modules/mailman/files/templates/nl/listinfo.html
diff --git a/files/mailman/templates/no/listinfo.html 
b/modules/mailman/files/templates/no/listinfo.html
similarity index 100%
rename from files/mailman/templates/no/listinfo.html
rename to modules/mailman/files/templates/no/listinfo.html
diff --git a/files/mailman/templates/pl/listinfo.html 
b/modules/mailman/files/templates/pl/listinfo.html
similarity index 100%
rename from files/mailman/templates/pl/listinfo.html
rename to modules/mailman/files/templates/pl/listinfo.html
diff --git a/files/mailman/templates/pt/listinfo.html 
b/modules/mailman/files/templates/pt/listinfo.html
similarity index 100%
rename from files/mailman/templates/pt/listinfo.html
rename to modules/mailman/files/templates/pt/listinfo.html
diff --git a/files/mailman/templates/pt_BR/listinfo.html 
b/modules/mailman/files/templates/pt_BR/listinfo.html
similarity index 100%
rename from files/mailman/templates/pt_BR/listinfo.html
rename to modules/mailman/files/templates/pt_BR/listinfo.html
diff --git a/files/mailman/templates/ru/listinfo.html 
b/modules/mailman/files/templates/ru/listinfo.html
similarity index 100%
rename from files/mailman/templates/ru/listinfo.html
rename to modules/mailman/files/templates/ru/listinfo.html
diff --git a/files/mailman/templates/sk/listinfo.html 
b/modules/mailman/files/templates/sk/listinfo.html
similarity index 100%
rename from files/mailman/templates/sk/listinfo.html
rename to modules/mailman/files/templates/sk/listinfo.html
diff --git a/files/mailman/templates/sv/listinfo.html 
b/modules/mailman/files/templates/sv/listinfo.html
similarity index 100%
rename from files/mailman/templates/sv/listinfo.html
rename to modules/mailman/files/templates/sv/listinfo.html
diff --git a/files/mailman/templates/ta/listinfo.html 
b/modules/mailman/files/templates/ta/listinfo.html
similarity index 100%
rename from files/mailman/templates/ta/listinfo.html
rename to modules/mailman/files/templates/ta/listinfo.html
diff --git a/files/mailman/templates/uk/listinfo.html 
b/modules/mailman/files/templates/uk/listinfo.html
similarity index 100%
rename from files/mailman/templates/uk/listinfo.html
rename to modules/mailman/files/templates/uk/listinfo.html
diff --git a/files/mailman/templates/vi/listinfo.html 
b/modules/mailman/files/templates/vi/listinfo.html
similarity index 100%
rename from files/mailman/templates/vi/listinfo.html
rename to modules/mailman/files/templates/vi/listinfo.html
diff --git a/files/mailman/templates/zh/listinfo.html 
b/modules/mailman/files/templates/zh/listinfo.html
similarity index 100%
rename from files/mailman/templates/zh/listinfo.html
rename to modules/mailman/files/templates/zh/listinfo.html
diff --git a/modules/mailman/manifests/init.pp 
b/modules/mailman/manifests/init.pp
new file mode 100644
index 0000000..7409b2a
--- /dev/null
+++ b/modules/mailman/manifests/init.pp
@@ -0,0 +1,4 @@
+class mailman {
+    include mailman::listserve
+    include mailman::webui
+}
diff --git a/modules/mailman/manifests/listserve.pp 
b/modules/mailman/manifests/listserve.pp
new file mode 100644
index 0000000..933b95d
--- /dev/null
+++ b/modules/mailman/manifests/listserve.pp
@@ -0,0 +1,43 @@
+class mailman::listserve {
+    package { 'mailman':
+        ensure => present,
+    }
+
+    file { '/etc/mailman/mm_cfg.py':
+        owner  => 'root',
+        group  => 'root',
+        mode   => '0444',
+        source => 'puppet:///modules/mailman/mm_cfg.py',
+    }
+
+    # Install as many languages as possible
+    include locales::extended
+
+    debconf::set { 'mailman/gate_news':
+        value  => 'false',
+        notify => Exec['dpkg-reconfigure mailman'],
+    }
+
+    debconf::set { 'mailman/site_languages':
+        value  => 'ar, ast, ca, cs, da, de, en, es, et, eu, fi, fr, gl, he, 
hr, hu, ia, it, ja, ko, lt, nl, no, pl, pt, pt_BR, ro, ru, sk, sl, sr, sv, tr, 
uk, vi, zh_CN, zh_TW',
+        notify => Exec['dpkg-reconfigure mailman'],
+    }
+
+    debconf::set { 'mailman/default_server_language':
+        value  => 'en',
+        notify => Exec['dpkg-reconfigure mailman'],
+    }
+
+    exec { 'dpkg-reconfigure mailman':
+        command     => '/usr/sbin/dpkg-reconfigure -fnoninteractive mailman',
+        refreshonly => true,
+        require     => Class['locales::extended'],
+        before      => Service['mailman'],
+    }
+
+    service { 'mailman':
+        ensure    => running,
+        hasstatus => false,
+        pattern   => 'mailmanctl',
+    }
+}
diff --git a/modules/mailman/manifests/webui.pp 
b/modules/mailman/manifests/webui.pp
new file mode 100644
index 0000000..cf7fcc3
--- /dev/null
+++ b/modules/mailman/manifests/webui.pp
@@ -0,0 +1,51 @@
+class mailman::webui {
+    include ::apache
+    apache::mod_conf { [
+        'ssl',
+        'headers',
+        'rewrite',
+        'alias',
+        'setenvif',
+        'auth_digest',
+    ]: }
+
+    $ssl_settings = ssl_ciphersuite('apache-2.2', 'compat', '365')
+    apache::site { 'lists.wikimedia.org':
+        content => template('mailman/lists.wikimedia.org.erb'),
+    }
+
+    # htdigest file for private list archives
+    file { '/etc/apache2/arbcom-l.htdigest':
+        source  => 'puppet:///private/mailman/arbcom-l.htdigest',
+        owner   => 'root',
+        group   => 'www-data',
+        mode    => '0440',
+        require => Class['apache'],
+    }
+
+    # Add files in /var/www (docroot)
+    file { '/var/www':
+        source  => 'puppet:///modules/mailman/docroot/',
+        owner   => 'root',
+        group   => 'root',
+        mode    => '0444',
+        recurse => 'remote',
+    }
+
+    # Add a new default theme to make mailman prettier
+    file { '/var/lib/mailman/templates':
+        ensure  => link,
+        target  => '/etc/mailman',
+    }
+
+    # Add default theme to make mailman prettier.
+    #  Recurse => remote adds a bunch of files here and there
+    #  while leaving the by-hand mailman config files in place.
+    file { '/etc/mailman':
+        source  => 'puppet:///modules/mailman/templates/',
+        owner   => 'root',
+        group   => 'root',
+        mode    => '0444',
+        recurse => 'remote',
+    }
+}
diff --git a/templates/apache/sites/lists.wikimedia.org.erb 
b/modules/mailman/templates/lists.wikimedia.org.erb
similarity index 100%
rename from templates/apache/sites/lists.wikimedia.org.erb
rename to modules/mailman/templates/lists.wikimedia.org.erb

-- 
To view, visit https://gerrit.wikimedia.org/r/185404
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I38660ba8533c47caf823a77890dc66b38c870957
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Faidon Liambotis <fai...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to