Merge branch 'master' of git+ssh://puppet.debian.org/srv/puppet.debian.org/git/dsa...
authorMartin Zobel-Helas <zobel@debian.org>
Sun, 19 Mar 2017 09:35:29 +0000 (10:35 +0100)
committerMartin Zobel-Helas <zobel@debian.org>
Sun, 19 Mar 2017 09:35:29 +0000 (10:35 +0100)
* 'master' of git+ssh://puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet: (32 commits)
  Do not use sslname empty string for no ssl
  Make scores of webserver related templates compile
  Fix historical mirror apache template
  make order a string
  fix torrc-header tempate
  fix rsync site module
  if we do not have specific binds, we use the empty string to signal that
  Fix stunnel template
  Attempt to fix version comparisons
  Fix munin::conf for new puppet
  Fix schroot-buildd/fstab.erb template
  Remove wheezy support in schroot files
  Remove wheezy support in buildd files
  Make concat::fragment order parameter be a string
  buildd: fix lsbmajdistrelease calls
  fix template
  fix two templates
  fix two templates
  rename nfs-server to nfs_server
  remove rng-tools without hwrandom
  ...

72 files changed:
manifests/site.pp
modules/acpi/manifests/init.pp
modules/apache2/manifests/init.pp
modules/apache2/manifests/site.pp
modules/apache2/templates/default-debian.org.erb
modules/apache2/templates/puppet-config.erb
modules/bacula/manifests/client.pp
modules/buildd/files/buildd-schroot-aptitude-kill.wheezy [deleted file]
modules/buildd/files/sbuild.conf.wheezy [deleted file]
modules/buildd/manifests/init.pp
modules/debian_org/manifests/apt.pp
modules/debian_org/manifests/init.pp
modules/debian_org/templates/dsa-puppet-stuff.cron.erb
modules/exim/manifests/init.pp
modules/exim/manifests/vdomain/setup.pp
modules/exim/templates/eximconf.erb
modules/ferm/manifests/init.pp
modules/ferm/templates/ferm.conf.erb
modules/ferm/templates/me.conf.erb
modules/hardware/manifests/raid.pp
modules/hardware/manifests/raid/raidmpt.pp
modules/hardware/manifests/sensors.pp
modules/monit/manifests/init.pp
modules/munin/manifests/conf.pp
modules/nagios/templates/obsolete-packages-ignore.d-hostspecific.erb
modules/nfs-server/files/lockd.local.modprobe [deleted file]
modules/nfs-server/files/nfs-common.default [deleted file]
modules/nfs-server/files/nfs-kernel-server.default [deleted file]
modules/nfs-server/manifests/init.pp [deleted file]
modules/nfs_server/files/lockd.local.modprobe [new file with mode: 0644]
modules/nfs_server/files/nfs-common.default [new file with mode: 0644]
modules/nfs_server/files/nfs-kernel-server.default [new file with mode: 0644]
modules/nfs_server/manifests/init.pp [new file with mode: 0644]
modules/onion/manifests/balance.pp
modules/onion/manifests/init.pp
modules/onion/manifests/service.pp
modules/onion/templates/torrc-header.erb
modules/portforwarder/manifests/init.pp
modules/postgres/manifests/init.pp
modules/resolv/templates/resolv.conf.erb
modules/rng_tools/manifests/init.pp
modules/roles/manifests/ftp.pp
modules/roles/manifests/ftp_upload.pp
modules/roles/manifests/historical_mirror.pp
modules/roles/manifests/ports_master.pp
modules/roles/manifests/postgresql_server.pp
modules/roles/manifests/pubsub/config.pp
modules/roles/manifests/security_mirror.pp
modules/roles/manifests/syncproxy.pp
modules/roles/templates/apache-archive.debian.org.erb
modules/roles/templates/apache-debug.mirrors.debian.org.erb
modules/roles/templates/apache-ftp.debian.org.erb
modules/roles/templates/apache-ftp.ports.debian.org.erb
modules/roles/templates/apache-www.debian.org.erb
modules/roles/templates/postgresql_server/pg-backup-file.conf.erb
modules/roles/templates/static-mirroring/static-vhost.conf.erb
modules/roles/templates/static-mirroring/vhost/planet.debian.org.erb
modules/roles/templates/static-mirroring/vhost/static-vhosts-simple.erb
modules/roles/templates/syncproxy/rsyncd.conf.erb
modules/roles/templates/syncproxy/syncproxy.debian.org-apache.erb
modules/roles/templates/syncproxy/syncproxy.debian.org-index.html.erb
modules/rsync/manifests/site.pp
modules/rsync/templates/rsyncd-stunnel.conf.erb
modules/samhain/templates/samhainrc.erb
modules/schroot/manifests/init.pp
modules/schroot/templates/schroot-buildd/fstab.erb
modules/ssh/manifests/init.pp
modules/ssh/templates/sshd_config.erb
modules/ssl/templates/chained.erb
modules/ssl/templates/key-chained.erb
modules/stunnel4/templates/stunnel.conf.erb
modules/systemdtimesyncd/templates/timesyncd.conf.erb

index 28a443c..97e962a 100644 (file)
@@ -40,6 +40,9 @@ node default {
        include grub
        include multipath
        include popcon
+       include portforwarder
+       include postgres
+
        if $::lsbdistcodename == squeeze {
                include roles::udldap::client
        } else {
@@ -97,17 +100,13 @@ node default {
        }
 
        if $::hostname in [buxtehude,milanollo,lw01,lw02,lw03,lw04,senfter,gretchaninov] {
-               include nfs-server
+               include nfs_server
        }
 
        if $::brokenhosts {
                include hosts
        }
 
-       if $::portforwarder_user_exists {
-               include portforwarder
-       }
-
        if $::samhain {
                include samhain
        }
@@ -116,10 +115,6 @@ node default {
                include debian_org::radvd
        }
 
-       if ($::postgres) {
-               include postgres
-       }
-
        if $::spamd {
                munin::check { 'spamassassin': }
        }
index f2c621b..2a4fc15 100644 (file)
@@ -1,6 +1,6 @@
 class acpi {
        if ! ($::debarchitecture in ['kfreebsd-amd64', 'kfreebsd-i386']) {
-               if ($::lsbmajdistrelease >= '8') {
+               if (versioncmp($::lsbmajdistrelease, '8') >= 0) {
                        package { 'acpid':
                                ensure => purged
                        }
index 19400ad..b0bde41 100644 (file)
@@ -105,7 +105,7 @@ class apache2 {
                apache2::module { 'mpm_prefork': ensure => absent }
                apache2::module { 'mpm_worker': }
        }
-       if $::lsbmajdistrelease > '7' {
+       if versioncmp($::lsbmajdistrelease, '7') > 0 {
                file { '/etc/apache2/mods-available/mpm_worker.conf':
                        content => template('apache2/mpm_worker.erb'),
                }
index ff1ee20..6d5ec55 100644 (file)
@@ -46,7 +46,7 @@ define apache2::site (
                }
        }
 
-       if $::lsbmajdistrelease <= '7' {
+       if versioncmp($::lsbmajdistrelease, '7') <= 0 {
                $symlink = "/etc/apache2/sites-enabled/${name}"
        } else {
                $symlink = "/etc/apache2/sites-enabled/${name}.conf"
index dff8a4f..0c9eff3 100644 (file)
@@ -10,7 +10,7 @@
        CustomLog /var/log/apache2/access.log privacy
 
        DocumentRoot /srv/www/default.debian.org/htdocs
-       <% if @lsbmajdistrelease > '7' -%>
+       <% if scope.call_function('versioncmp', [@lsbmajdistrelease, '7']) > 0 -%>
        <Directory /srv/www/default.debian.org/htdocs>
                Require all granted
        </Directory>
index 3a7134d..7c38884 100644 (file)
@@ -4,13 +4,13 @@
 
   # this is a list that seems suitable as of 2014-10, when running wheezy.  It
   # probably requires re-visiting regularly.
-  <% if @lsbmajdistrelease <= '7' -%>
+  <% if scope.call_function('versioncmp', [@lsbmajdistrelease, '7']) <= 0 -%>
     SSLCipherSuite ECDH+AESGCM:ECDH+AES256:ECDH+AES128:ECDH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!eNULL:!LOW:!MD5:!EXP:!RC4:!SEED:!DSS
   <% else -%>
     SSLCipherSuite ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!eNULL:!LOW:!MD5:!EXP:!RC4:!SEED:!DSS
   <% end -%>
 
-  <%- if has_variable?("apache2deb9") && @apache2deb9 == "true" -%>
+  <%- if has_variable?("apache2deb9") && @apache2deb9 -%>
     SSLUseStapling On
 
     # the default size is 32k, but we make it 1M.
index 05234fc..2918a79 100644 (file)
@@ -50,7 +50,7 @@ class bacula::client inherits bacula {
                require => Package['bacula-fd'],
                notify  => Service['bacula-fd'],
        }
-       if ($::lsbmajdistrelease >= '9' and $systemd) {
+       if (versioncmp($::lsbmajdistrelease, '9') >= 0 and $systemd) {
                file { '/etc/systemd/system/bacula-fd.service.d':
                        ensure  => directory,
                        mode    => '0755',
diff --git a/modules/buildd/files/buildd-schroot-aptitude-kill.wheezy b/modules/buildd/files/buildd-schroot-aptitude-kill.wheezy
deleted file mode 100755 (executable)
index c73667a..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/usr/bin/python
-
-# kills aptitude processes that eat an excessive amount of resources
-
-# Copyright 2013 Peter Palfrader
-#
-# Permission is hereby granted, free of charge, to any person obtaining
-# a copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice shall be
-# included in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-import os
-import errno
-import sys
-try:
-       import psutil
-except OSError, e:
-       # XXX: This is a hack, but since we are run from cron, it's
-       # better to handle this on the next run than to send mail.
-       if e.errno == errno.ENOENT:
-               sys.exit(0)
-
-total_mem = psutil.phymem_usage().total
-cutoff_time = 60*10
-
-for p in psutil.process_iter():
-       try:
-               if p.name != 'aptitude': continue
-               parent = p.parent
-               if parent is None: continue
-               if parent.name != 'schroot': continue
-               #
-               try:
-                       rootdir = os.readlink('/proc/%d/root'%(p.pid,))
-               except OSError as e:
-                       if e.errno == errno.ENOENT:
-                               continue
-                       else:
-                               raise e
-               if not rootdir.startswith('/var/lib/schroot/mount'): continue
-               #
-               used = p.get_memory_info().vms
-               if used < total_mem: continue
-               #
-               cputime = p.get_cpu_times().user
-               if cputime < cutoff_time: continue
-               #
-               p.kill()
-       except psutil.error.NoSuchProcess:
-               pass
diff --git a/modules/buildd/files/sbuild.conf.wheezy b/modules/buildd/files/sbuild.conf.wheezy
deleted file mode 100644 (file)
index 6bfb6db..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-##
-## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
-## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
-##
-1;
index 205730b..f821eac 100644 (file)
@@ -31,16 +31,9 @@ class buildd ($ensure=present) {
                                source  => 'puppet:///modules/buildd/buildd.conf',
                                require => Package['buildd'],
                        }
-                       if ($::lsbmajdistrelease >= 8) {
-                               file { '/etc/sbuild/sbuild.conf':
-                                       source  => 'puppet:///modules/buildd/sbuild.conf',
-                                       require => Package['sbuild'],
-                               }
-                       } else {
-                               file { '/etc/sbuild/sbuild.conf':
-                                       source  => 'puppet:///modules/buildd/sbuild.conf.wheezy',
-                                       require => Package['sbuild'],
-                               }
+                       file { '/etc/sbuild/sbuild.conf':
+                               source  => 'puppet:///modules/buildd/sbuild.conf',
+                               require => Package['sbuild'],
                        }
                        include ferm::ftp_conntrack
                }
@@ -85,16 +78,9 @@ class buildd ($ensure=present) {
                        package { 'python-psutil':
                                ensure => installed,
                        }
-                       if ($::lsbmajdistrelease >= 8) {
-                               file { '/usr/local/sbin/buildd-schroot-aptitude-kill':
-                                       source  => 'puppet:///modules/buildd/buildd-schroot-aptitude-kill',
-                                       mode    => '0555',
-                               }
-                       } else {
-                               file { '/usr/local/sbin/buildd-schroot-aptitude-kill':
-                                       source  => 'puppet:///modules/buildd/buildd-schroot-aptitude-kill.wheezy',
-                                       mode    => '0555',
-                               }
+                       file { '/usr/local/sbin/buildd-schroot-aptitude-kill':
+                               source  => 'puppet:///modules/buildd/buildd-schroot-aptitude-kill',
+                               mode    => '0555',
                        }
                } else {
                        file { '/usr/local/sbin/buildd-schroot-aptitude-kill':
index 9fc02a0..948f606 100644 (file)
@@ -3,7 +3,7 @@
 # Stuff common to all debian.org servers
 #
 class debian_org::apt {
-       if $::lsbmajdistrelease <= '7' {
+       if versioncmp($::lsbmajdistrelease, '7') <= 0 {
                $mungedcodename = $::lsbdistcodename
        } elsif ($::debarchitecture in ['kfreebsd-amd64', 'kfreebsd-i386']) {
                $mungedcodename = "${::lsbdistcodename}-kfreebsd"
@@ -11,7 +11,7 @@ class debian_org::apt {
                $mungedcodename = $::lsbdistcodename
        }
 
-       if $::lsbmajdistrelease <= '8' {
+       if versioncmp($::lsbmajdistrelease, '8') <= 0 {
                $fallbackmirror = 'http://cdn-fastly.deb.debian.org/debian/'
        } else {
                $fallbackmirror = 'http://deb.debian.org/debian/'
index 6cb629e..a7ff786 100644 (file)
@@ -43,7 +43,7 @@ class debian_org {
                source  => 'puppet:///modules/debian_org/basic-ssh_known_hosts'
        }
 
-       if ($::lsbmajdistrelease >= '8') {
+       if versioncmp($::lsbmajdistrelease, '8') >= 0 {
                $rubyfs_package = 'ruby-filesystem'
        } else {
                $rubyfs_package = 'libfilesystem-ruby1.9'
@@ -136,7 +136,7 @@ class debian_org {
        }
        file { '/etc/puppet/puppet.conf':
                content => template('debian_org/puppet.conf.erb'),
-               mode => 0440,
+               mode => '0440',
                group => 'puppet',
        }
        file { '/etc/default/puppet':
@@ -144,11 +144,11 @@ class debian_org {
        }
        file { '/etc/systemd':
                ensure  => directory,
-               mode => 0755,
+               mode => '0755',
        }
        file { '/etc/systemd/system':
                ensure  => directory,
-               mode => 0755,
+               mode => '0755',
        }
        file { '/etc/systemd/system/ud-replicated.service':
                ensure => $servicefiles,
index 48fab72..60f2f5a 100644 (file)
@@ -5,7 +5,7 @@
 
 SHELL=/bin/bash
 @hourly  root [ ! -d /var/cache/dsa ] || touch /var/cache/dsa/cron.alive
-<% if @lsbmajdistrelease <= '7' -%>
+<% if scope.call_function('versioncmp', [@lsbmajdistrelease, '7']) <= 0 -%>
 34 */4 * * * root if [ -x /usr/sbin/puppetd ]; then sleep $(( $RANDOM \% 7200 )); if [ -x /usr/bin/timeout ]; then TO="timeout --kill-after=900 3600"; else TO=""; fi; tmp="$(tempfile)"; egrep -v '^(#|$)' /etc/dsa/cron.ignore.dsa-puppet-stuff > "$tmp" && $TO /usr/sbin/puppetd -o --no-daemonize 2>&1 | egrep --text -v -f "$tmp"; rm -f "$tmp"; fi
 <% else -%>
 34 */4 * * * root if [ -x /usr/bin/puppet ]; then sleep $(( $RANDOM \% 7200 )); if [ -x /usr/bin/timeout ]; then TO="timeout --kill-after=900 3600"; else TO=""; fi; tmp="$(tempfile)"; egrep -v '^(#|$)' /etc/dsa/cron.ignore.dsa-puppet-stuff > "$tmp" && $TO /usr/bin/puppet agent --onetime --no-daemonize 2>&1 | egrep --text -v -f "$tmp"; rm -f "$tmp"; fi
index ae73205..4ff0fb1 100644 (file)
@@ -24,7 +24,7 @@ class exim {
        concat::fragment { 'virtual_domain_template':
                target  => '/etc/exim4/virtualdomains',
                content => template('exim/virtualdomains.erb'),
-               order   => 05,
+               order   => '05',
        }
 
        service { 'exim4':
index 8be0c26..2765fba 100644 (file)
@@ -10,6 +10,6 @@ class exim::vdomain::setup {
        concat::fragment { 'virtualdomains_header':
                target => '/etc/exim4/virtualdomains',
                source => 'puppet:///modules/exim/virtualdomains.header',
-               order  => 00,
+               order  => '00',
        }
 }
index 93ec708..1c8dcf0 100644 (file)
@@ -211,7 +211,7 @@ queue_only_load = 8
 <%- end -%>
 queue_list_requires_admin = false
 
-<%- if has_variable?("clamd") && @clamd == "true" -%>
+<%- if has_variable?("clamd") && @clamd -%>
 av_scanner = clamd:/var/run/clamav/clamd.ctl
 <%- end -%>
 
@@ -663,7 +663,7 @@ check_recipient:
           ratelimit      = 10 / 60m / per_rcpt / $sender_host_address
           message        = slow down (no reverse dns, mismatched ehlo, dialup, or in blacklists)
 
-<%- if has_variable?("policydweight") && @policydweight == "true" -%>
+<%- if has_variable?("policydweight") && @policydweight -%>
   # Check with policyd-weight - this only works with a version after etch's,
   # sadly.  etch's version attempts to hold the socket open, since that's what
   # postfix expects.  Exim, on the other hand, expects the remote side to close
@@ -734,7 +734,7 @@ check_recipient:
 
 
 <%- end -%>
-<%- if has_variable?("greylistd") && @greylistd == "true" -%>
+<%- if has_variable?("greylistd") && @greylistd -%>
   defer
     message  = $sender_host_address is not yet authorized to deliver mail from <$sender_address> to <$local_part@$domain>.
     log_message = greylisted.
@@ -759,7 +759,7 @@ check_recipient:
                                   $local_part@$domain}\
                                  {5s}{}{false}}
 
-<%- elsif has_variable?("postgrey") && @postgrey == "true" -%>
+<%- elsif has_variable?("postgrey") && @postgrey -%>
   # next three are greylisting, inspired by http://www.bebt.de/blog/debian/archives/2006/07/30/T06_12_27/index.html
   # this adds acl_m_grey if there isn't one (so unique per message)
   warn
@@ -956,7 +956,7 @@ check_message:
           condition       = ${if eq {$acl_m_prf}{PopconMail}{no}{yes}}
          message         = Your mailer is not RFC 2047 compliant: message rejected
 
-<%- if has_variable?("clamd") && @clamd == "true" -%>
+<%- if has_variable?("clamd") && @clamd -%>
   discard condition       = ${if eq {$acl_m_prf}{blackhole}}
           demime          = *
           malware         = */defer_ok
index 869a3d6..23dfc2a 100644 (file)
@@ -16,7 +16,7 @@ class ferm {
        package { 'ferm':
                ensure => installed
        }
-       if ($::lsbmajdistrelease >= '8') {
+       if (versioncmp($::lsbmajdistrelease, '8') >= 0) {
                package { 'ulogd2':
                        ensure => installed
                }
@@ -92,7 +92,7 @@ class ferm {
                content => template('ferm/interfaces.conf.erb'),
                notify  => Service['ferm'],
        }
-       if ($::lsbmajdistrelease >= '8') {
+       if (versioncmp($::lsbmajdistrelease, '8') >= 0) {
                augeas { 'logrotate_ulogd2':
                        context => '/files/etc/logrotate.d/ulogd2',
                        changes => [
index 5d63f8d..b8a6b69 100644 (file)
@@ -7,7 +7,7 @@
 
 @include 'conf.d/';
 
-<% if @lsbmajdistrelease >= '8' -%>
+<% if scope.call_function('versioncmp', [@lsbmajdistrelease, '8']) >= 0 -%>
 domain (ip ip6) {
         table filter {
               chain log_and_reject {
index 627e4bf..75f0d5c 100644 (file)
@@ -13,7 +13,7 @@ restrict_ssh = %w{tchaikovsky draghi adayevskaya}
 if (nodeinfo['ldap'].has_key?('purpose')) then
        nodeinfo['ldap']['purpose'].each do |purp|
                if restricted_purposes.include?(purp) then
-                       restrict_ssh << hostname
+                       restrict_ssh << @hostname
                end
        end
 end
index 3affb89..d682c30 100644 (file)
@@ -7,8 +7,5 @@ class hardware::raid {
                include hardware::raid::megactl
        }
 
-       if $::mptraid {
-               include hardware::raid::raidmpt
-       }
-
+       include hardware::raid::raidmpt
 }
index c512913..f371c72 100644 (file)
@@ -7,18 +7,27 @@
 #   include hardware::raid::raidmpt
 #
 class hardware::raid::raidmpt {
+       if $::mptraid {
+               package { 'mpt-status':
+                       ensure => installed
+               }
 
-       package { 'mpt-status':
-               ensure => installed
-       }
+               file { '/etc/default/mpt-statusd':
+                       content => "# This file is under puppet control\nRUN_DAEMON=no\n",
+                       notify  => Exec['mpt-statusd-stop'],
+               }
 
-       file { '/etc/default/mpt-statusd':
-               content => "# This file is under puppet control\nRUN_DAEMON=no\n",
-               notify  => Exec['mpt-statusd-stop'],
-       }
+               exec { 'mpt-statusd-stop':
+                       command => 'pidfile=/var/run/mpt-statusd.pid; ! [ -e "$pidfile" ] || /sbin/start-stop-daemon --oknodo --stop --signal TERM --quiet --pidfile "$pidfile"; rm -f "$pidfile";  pkill -INT  -P 1 -u 0 -f "/usr/bin/daemon /etc/init.d/mpt-statusd check_mpt"',
+                       refreshonly => true,
+               }
+       } else {
+               package { 'mpt-status':
+                       ensure => purged,
+               }
 
-       exec { 'mpt-statusd-stop':
-               command => 'pidfile=/var/run/mpt-statusd.pid; ! [ -e "$pidfile" ] || /sbin/start-stop-daemon --oknodo --stop --signal TERM --quiet --pidfile "$pidfile"; rm -f "$pidfile";  pkill -INT  -P 1 -u 0 -f "/usr/bin/daemon /etc/init.d/mpt-statusd check_mpt"',
-               refreshonly => true,
+               file { '/etc/default/mpt-statusd':
+                       ensure => absent,
+               }
        }
 }
index b52b95e..d835c93 100644 (file)
@@ -2,5 +2,8 @@ class hardware::sensors {
        if $::hw_can_temp_sensors {
                package { 'lm-sensors': ensure => installed, }
                munin::check { 'sensors_temp': script => 'sensors_' }
+       } else {
+               package { 'lm-sensors': ensure => purged, }
+               munin::check { 'sensors_temp': ensure => absent }
        }
 }
index 977f184..999cdfb 100644 (file)
@@ -7,7 +7,7 @@
 #   include monit
 #
 class monit {
-       if $::lsbmajdistrelease <= '7' {
+       if versioncmp($::lsbmajdistrelease, '7') <= 0 {
                package { 'monit':
                        ensure => installed
                }
index ad557ab..5413c43 100644 (file)
@@ -1,7 +1,7 @@
 define munin::conf (
        $ensure=present,
-       $content='',
-       $source=''
+       $content=false,
+       $source=false
 ) {
 
        include munin
index 8f81582..a1265ff 100644 (file)
@@ -14,7 +14,7 @@ when "sibelius.debian.org" then                                ignore << %w{tivs
 when /(storace|backuphost).debian.org/ then                    ignore << %w{postgresql-client-9.1}
 end
 
-if @lsbmajdistrelease <= '8'
+if scope.call_function('versioncmp', [@lsbmajdistrelease, '8']) <= 0
   case @fqdn
     when /(acker|aagaard).debian.org/ then                     ignore << %w{qemu-efi}
   end
diff --git a/modules/nfs-server/files/lockd.local.modprobe b/modules/nfs-server/files/lockd.local.modprobe
deleted file mode 100644 (file)
index 105d4b5..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-##
-## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
-## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
-##
-
-options lockd nlm_udpport=10003 nlm_tcpport=10003
diff --git a/modules/nfs-server/files/nfs-common.default b/modules/nfs-server/files/nfs-common.default
deleted file mode 100644 (file)
index 93f6598..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-##
-## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
-## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
-##
-
-# If you do not set values for the NEED_ options, they will be attempted
-# autodetected; this should be sufficient for most people. Valid alternatives
-# for the NEED_ options are "yes" and "no".
-
-# Do you want to start the statd daemon? It is not needed for NFSv4.
-NEED_STATD=
-
-# Options for rpc.statd.
-#   Should rpc.statd listen on a specific port? This is especially useful
-#   when you have a port-based firewall. To use a fixed port, set this
-#   this variable to a statd argument like: "--port 4000 --outgoing-port 4001".
-#   For more information, see rpc.statd(8) or http://wiki.debian.org/SecuringNFS
-STATDOPTS='--port 10000 -o 10001'
-
-# Do you want to start the idmapd daemon? It is only needed for NFSv4.
-NEED_IDMAPD=
-
-# Do you want to start the gssd daemon? It is required for Kerberos mounts.
-NEED_GSSD=
diff --git a/modules/nfs-server/files/nfs-kernel-server.default b/modules/nfs-server/files/nfs-kernel-server.default
deleted file mode 100644 (file)
index d40255f..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-##
-## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
-## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
-##
-
-# Number of servers to start up
-RPCNFSDCOUNT=8
-
-# Runtime priority of server (see nice(1))
-RPCNFSDPRIORITY=0
-
-# Options for rpc.mountd.
-# If you have a port-based firewall, you might want to set up
-# a fixed port here using the --port option. For more information, 
-# see rpc.mountd(8) or http://wiki.debian.org/?SecuringNFS
-RPCMOUNTDOPTS="-p 10002"
-
-# Do you want to start the svcgssd daemon? It is only required for Kerberos
-# exports. Valid alternatives are "yes" and "no"; the default is "no".
-NEED_SVCGSSD=
-
-# Options for rpc.svcgssd.
-RPCSVCGSSDOPTS=
diff --git a/modules/nfs-server/manifests/init.pp b/modules/nfs-server/manifests/init.pp
deleted file mode 100644 (file)
index 7021ef3..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-class nfs-server {
-
-       package { [
-                       'nfs-common',
-                       'nfs-kernel-server'
-               ]:
-               ensure => installed
-       }
-
-       service { 'nfs-common':
-               hasstatus   => false,
-               status      => '/bin/true',
-       }
-       service { 'nfs-kernel-server':
-               hasstatus   => false,
-               status      => '/bin/true',
-       }
-
-       case $::hostname {
-               lw01,lw02,lw03,lw04: {
-                       $client_range    = '10.0.0.0/8'
-               }
-               milanollo,senfter: {
-                       $client_range    = '172.29.122.0/24'
-               }
-               buxtehude: {
-                       $client_range    = '(172.29.40.0/22 206.12.19.126/32)'
-               }
-               gretchaninov: {
-                       $client_range    = '172.29.40.0/22'
-               }
-               default: {
-                       # Better than 0.0.0.0/0 - we really ought to configure a
-                       # client range for them all instead of exporting to the world.
-                       $client_range    = '127.0.0.0/8'
-               }
-       }
-
-       @ferm::rule { 'dsa-portmap':
-               description => 'Allow portmap access',
-               rule        => "&TCP_UDP_SERVICE_RANGE(111, $client_range)"
-       }
-       @ferm::rule { 'dsa-nfs':
-               description => 'Allow nfsd access',
-               rule        => "&TCP_UDP_SERVICE_RANGE(2049, $client_range)"
-       }
-       @ferm::rule { 'dsa-status':
-               description => 'Allow statd access',
-               rule        => "&TCP_UDP_SERVICE_RANGE(10000, $client_range)"
-       }
-       @ferm::rule { 'dsa-mountd':
-               description => 'Allow mountd access',
-               rule        => "&TCP_UDP_SERVICE_RANGE(10002, $client_range)"
-       }
-       @ferm::rule { 'dsa-lockd':
-               description => 'Allow lockd access',
-               rule        => "&TCP_UDP_SERVICE_RANGE(10003, $client_range)"
-       }
-
-       file { '/etc/default/nfs-common':
-               source  => 'puppet:///modules/nfs-server/nfs-common.default',
-               before  => Package['nfs-common'],
-               notify  => Service['nfs-common'],
-       }
-       file { '/etc/default/nfs-kernel-server':
-               source  => 'puppet:///modules/nfs-server/nfs-kernel-server.default',
-               before  => Package['nfs-kernel-server'],
-               notify  => Service['nfs-kernel-server'],
-       }
-       file { '/etc/modprobe.d/lockd.local':
-               source => 'puppet:///modules/nfs-server/lockd.local.modprobe',
-               before => Package['nfs-common'],
-               notify => Service['nfs-common'],
-       }
-}
diff --git a/modules/nfs_server/files/lockd.local.modprobe b/modules/nfs_server/files/lockd.local.modprobe
new file mode 100644 (file)
index 0000000..105d4b5
--- /dev/null
@@ -0,0 +1,6 @@
+##
+## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
+## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
+##
+
+options lockd nlm_udpport=10003 nlm_tcpport=10003
diff --git a/modules/nfs_server/files/nfs-common.default b/modules/nfs_server/files/nfs-common.default
new file mode 100644 (file)
index 0000000..93f6598
--- /dev/null
@@ -0,0 +1,24 @@
+##
+## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
+## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
+##
+
+# If you do not set values for the NEED_ options, they will be attempted
+# autodetected; this should be sufficient for most people. Valid alternatives
+# for the NEED_ options are "yes" and "no".
+
+# Do you want to start the statd daemon? It is not needed for NFSv4.
+NEED_STATD=
+
+# Options for rpc.statd.
+#   Should rpc.statd listen on a specific port? This is especially useful
+#   when you have a port-based firewall. To use a fixed port, set this
+#   this variable to a statd argument like: "--port 4000 --outgoing-port 4001".
+#   For more information, see rpc.statd(8) or http://wiki.debian.org/SecuringNFS
+STATDOPTS='--port 10000 -o 10001'
+
+# Do you want to start the idmapd daemon? It is only needed for NFSv4.
+NEED_IDMAPD=
+
+# Do you want to start the gssd daemon? It is required for Kerberos mounts.
+NEED_GSSD=
diff --git a/modules/nfs_server/files/nfs-kernel-server.default b/modules/nfs_server/files/nfs-kernel-server.default
new file mode 100644 (file)
index 0000000..d40255f
--- /dev/null
@@ -0,0 +1,23 @@
+##
+## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
+## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
+##
+
+# Number of servers to start up
+RPCNFSDCOUNT=8
+
+# Runtime priority of server (see nice(1))
+RPCNFSDPRIORITY=0
+
+# Options for rpc.mountd.
+# If you have a port-based firewall, you might want to set up
+# a fixed port here using the --port option. For more information, 
+# see rpc.mountd(8) or http://wiki.debian.org/?SecuringNFS
+RPCMOUNTDOPTS="-p 10002"
+
+# Do you want to start the svcgssd daemon? It is only required for Kerberos
+# exports. Valid alternatives are "yes" and "no"; the default is "no".
+NEED_SVCGSSD=
+
+# Options for rpc.svcgssd.
+RPCSVCGSSDOPTS=
diff --git a/modules/nfs_server/manifests/init.pp b/modules/nfs_server/manifests/init.pp
new file mode 100644 (file)
index 0000000..5545114
--- /dev/null
@@ -0,0 +1,75 @@
+class nfs_server {
+
+       package { [
+                       'nfs-common',
+                       'nfs-kernel-server'
+               ]:
+               ensure => installed
+       }
+
+       service { 'nfs-common':
+               hasstatus   => false,
+               status      => '/bin/true',
+       }
+       service { 'nfs-kernel-server':
+               hasstatus   => false,
+               status      => '/bin/true',
+       }
+
+       case $::hostname {
+               lw01,lw02,lw03,lw04: {
+                       $client_range    = '10.0.0.0/8'
+               }
+               milanollo,senfter: {
+                       $client_range    = '172.29.122.0/24'
+               }
+               buxtehude: {
+                       $client_range    = '(172.29.40.0/22 206.12.19.126/32)'
+               }
+               gretchaninov: {
+                       $client_range    = '172.29.40.0/22'
+               }
+               default: {
+                       # Better than 0.0.0.0/0 - we really ought to configure a
+                       # client range for them all instead of exporting to the world.
+                       $client_range    = '127.0.0.0/8'
+               }
+       }
+
+       @ferm::rule { 'dsa-portmap':
+               description => 'Allow portmap access',
+               rule        => "&TCP_UDP_SERVICE_RANGE(111, $client_range)"
+       }
+       @ferm::rule { 'dsa-nfs':
+               description => 'Allow nfsd access',
+               rule        => "&TCP_UDP_SERVICE_RANGE(2049, $client_range)"
+       }
+       @ferm::rule { 'dsa-status':
+               description => 'Allow statd access',
+               rule        => "&TCP_UDP_SERVICE_RANGE(10000, $client_range)"
+       }
+       @ferm::rule { 'dsa-mountd':
+               description => 'Allow mountd access',
+               rule        => "&TCP_UDP_SERVICE_RANGE(10002, $client_range)"
+       }
+       @ferm::rule { 'dsa-lockd':
+               description => 'Allow lockd access',
+               rule        => "&TCP_UDP_SERVICE_RANGE(10003, $client_range)"
+       }
+
+       file { '/etc/default/nfs-common':
+               source  => 'puppet:///modules/nfs_server/nfs-common.default',
+               before  => Package['nfs-common'],
+               notify  => Service['nfs-common'],
+       }
+       file { '/etc/default/nfs-kernel-server':
+               source  => 'puppet:///modules/nfs_server/nfs-kernel-server.default',
+               before  => Package['nfs-kernel-server'],
+               notify  => Service['nfs-kernel-server'],
+       }
+       file { '/etc/modprobe.d/lockd.local':
+               source => 'puppet:///modules/nfs_server/lockd.local.modprobe',
+               before => Package['nfs-common'],
+               notify => Service['nfs-common'],
+       }
+}
index 600aa24..855e7cd 100644 (file)
@@ -21,7 +21,7 @@ class onion::balance {
 
        concat::fragment { 'onion::torrc_control_header':
                target  => "/etc/tor/torrc",
-               order   => 10,
+               order   => '10',
                content => "ControlPort 9051\n\n",
        }
 
index 31543e9..c7b06c5 100644 (file)
@@ -26,7 +26,7 @@ class onion {
        }
        concat::fragment { 'onion::torrc_header':
                target  => "/etc/tor/torrc",
-               order   => 05,
+               order   => '05',
                content => template("onion/torrc-header.erb"),
        }
 }
index 80d6922..77ecc89 100644 (file)
@@ -19,7 +19,7 @@ define onion::service (
 
                concat::fragment { "onion::torrc_onionservice::${name}":
                        target  => "/etc/tor/torrc",
-                       order   => 50,
+                       order   => '50',
                        content => "HiddenServiceDir /var/lib/tor/onion/${name}\nHiddenServicePort ${port} ${target_address}:${target_port}\n\n",
                }
 
index 845adbf..b45b81d 100644 (file)
@@ -1,7 +1,7 @@
 SocksPort 0
 Log notice syslog
 
-<%- if has_variable?("tor_ge_0_2_9") && tor_ge_0_2_9 == "true" -%>
+<%- if has_variable?("tor_ge_0_2_9") && @tor_ge_0_2_9 -%>
 #HiddenServiceSingleHopMode 1
 #HiddenServiceNonAnonymousMode 1
 <%- end -%>
index e7009b2..e5a5982 100644 (file)
@@ -2,28 +2,37 @@ class portforwarder {
        # do not depend on xinetd, yet.  it might uninstall other inetds
        # for now this will have to be done manually
 
-       if ! $::portforwarder_key {
-               exec { 'create-portforwarder-key':
-                       command => '/bin/su - portforwarder -c \'mkdir -p -m 02700 .ssh && ssh-keygen -C "`whoami`@`hostname` (`date +%Y-%m-%d`)" -P "" -f .ssh/id_rsa -q\'',
-                       onlyif  => '/usr/bin/getent passwd portforwarder > /dev/null && ! [ -e /home/portforwarder/.ssh/id_rsa ]'
+       if $::portforwarder_user_exists {
+               if ! $::portforwarder_key {
+                       exec { 'create-portforwarder-key':
+                               command => '/bin/su - portforwarder -c \'mkdir -p -m 02700 .ssh && ssh-keygen -C "`whoami`@`hostname` (`date +%Y-%m-%d`)" -P "" -f .ssh/id_rsa -q\'',
+                               onlyif  => '/usr/bin/getent passwd portforwarder > /dev/null && ! [ -e /home/portforwarder/.ssh/id_rsa ]'
+                       }
                }
-       }
 
-       file { '/etc/ssh/userkeys/portforwarder':
-               content => template('portforwarder/authorized_keys.erb'),
-       }
-       file { '/etc/xinetd.d':
-               ensure  => directory,
-               owner   => root,
-               group   => root,
-               mode    => '0755',
-       }
-       file { '/etc/xinetd.d/dsa-portforwader':
-               content => template('portforwarder/xinetd.erb'),
-               notify  => Exec['service xinetd reload']
-       }
+               file { '/etc/ssh/userkeys/portforwarder':
+                       content => template('portforwarder/authorized_keys.erb'),
+               }
+               file { '/etc/xinetd.d':
+                       ensure  => directory,
+                       owner   => root,
+                       group   => root,
+                       mode    => '0755',
+               }
+               file { '/etc/xinetd.d/dsa-portforwader':
+                       content => template('portforwarder/xinetd.erb'),
+                       notify  => Exec['service xinetd reload']
+               }
 
-       exec { 'service xinetd reload':
-               refreshonly => true,
+               exec { 'service xinetd reload':
+                       refreshonly => true,
+               }
+       } else {
+               file { [
+                       '/etc/ssh/userkeys/portforwarder',
+                       '/etc/xinetd.d/dsa-portforwader',
+                       ]:
+                       ensure => 'absent',
+               }
        }
 }
index 4edc5c8..af2f206 100644 (file)
@@ -1,17 +1,30 @@
 class postgres {
-       munin::check { 'postgres_bgwriter': }
-       munin::check { 'postgres_connections_db': }
+       $ensure = ($::postgres) ? {
+               true    => 'ensure',
+               default => 'absent'
+       }
+
+       munin::check { 'postgres_bgwriter':
+               ensure => $ensure,
+               }
+       munin::check { 'postgres_connections_db':
+               ensure => $ensure,
+               }
        munin::check { 'postgres_cache_ALL':
+               ensure => $ensure,
                script => 'postgres_cache_'
        }
        munin::check { 'postgres_querylength_ALL':
+               ensure => $ensure,
                script => 'postgres_querylength_'
        }
        munin::check { 'postgres_size_ALL':
+               ensure => $ensure,
                script => 'postgres_size_'
        }
 
        file { '/etc/munin/plugin-conf.d/local-postgres':
+               ensure => $ensure,
                source  => 'puppet:///modules/postgres/plugin.conf',
        }
 }
index a42aa25..7733374 100644 (file)
@@ -15,7 +15,7 @@ if %w{draghi}.include?(@hostname)
 end
 nameservers += @ns
 
-if @unbound && @unbound == "true"
+if @unbound
   nameservers = ['127.0.0.1']
 end
 
index c8bb9ab..d1db5ba 100644 (file)
@@ -7,5 +7,9 @@ class rng_tools {
                        ensure  => running,
                        require => Package['rng-tools']
                }
+       } else {
+               package { 'rng-tools':
+                       ensure => purged
+               }
        }
 }
index bdb9f4b..5823032 100644 (file)
@@ -21,7 +21,7 @@ class roles::ftp {
                root         => '/srv/ftp.debian.org/ftp.root',
        }
 
-       if $bind6 {
+       if $bind6 != '' {
                vsftpd::site { 'ftp-v6':
                        banner       => 'ftp.debian.org FTP server',
                        logfile      => '/var/log/ftp/vsftpd-ftp.debian.org.log',
index 5612606..b553b70 100644 (file)
@@ -10,7 +10,7 @@ class roles::ftp_upload {
                root       => '/srv/upload.debian.org/ftp',
        }
 
-       if $bind6 {
+       if $bind6 != '' {
                vsftpd::site { 'ftp-upload-v6':
                        banner     => 'ftp.upload.debian.org FTP server',
                        logfile    => '/var/log/ftp/vsftpd-ftp.upload.debian.org.log',
index d80b1af..5036e8f 100644 (file)
@@ -29,7 +29,7 @@ class roles::historical_mirror {
                        tlsaport => [],
                }
        } else {
-               $sslname = ''
+               $sslname = undef
        }
 
        rsync::site_systemd { 'archive':
index d714d7c..fa7099a 100644 (file)
@@ -20,7 +20,7 @@ class roles::ports_master {
                root           => '/srv/ports-master.debian.org/ftp.upload',
        }
 
-       if $bind6 {
+       if $bind6 != '' {
                vsftpd::site { 'ports-master-v6':
                        banner         => 'ports-master.debian.org FTP server',
                        logfile        => '/var/log/ftp/vsftpd-ports-master.debian.org.log',
index 3fbaa63..25aa3e5 100644 (file)
@@ -1,10 +1,10 @@
 class roles::postgresql_server {
        file { "/usr/local/bin/pg-backup-file":
-               mode    => 555,
+               mode    => '0555',
                source  => "puppet:///modules/roles/postgresql_server/pg-backup-file",
        }
        file { "/usr/local/bin/pg-receive-file-from-backup":
-               mode    => 555,
+               mode    => '0555',
                source  => "puppet:///modules/roles/postgresql_server/pg-receive-file-from-backup",
        }
        file { "/etc/dsa/pg-backup-file.conf":
index 07289d3..24499bf 100644 (file)
@@ -55,7 +55,7 @@ define roles::pubsub::config (
        $exchange=dsa,
        $username=$::fqdn,
        $queue=undef,
-       $order=00
+       $order='00'
 ){
        include roles::pubsub::config::setup
 
index 1cda924..d135ffe 100644 (file)
@@ -48,7 +48,7 @@ class roles::security_mirror {
                        root         => '/srv/ftp.root/',
                        bind         => $ftp_bind,
                }
-               if ($ftp_bind6) {
+               if ($ftp_bind6 != '') {
                        vsftpd::site { 'security6':
                                banner       => 'security.debian.org FTP server (vsftpd)',
                                logfile      => '/var/log/ftp/vsftpd-security6.debian.org.log',
index 5d12d29..a08b5a7 100644 (file)
@@ -36,7 +36,7 @@ class roles::syncproxy {
        file { '/etc/rsyncd/debian.secrets':
                owner => 'root',
                group => 'mirroradm',
-               mode => 0660,
+               mode => '0660',
        }
 
        if $::apache2 and $syncproxy_name != 'unknown' {
index 84026e8..0cf3b0c 100644 (file)
@@ -4,11 +4,11 @@
 ##
 
 <%
-  if not binds.kind_of?(Array)
+  if not @binds.kind_of?(Array)
     raise Puppet::Error, "binds variable is not an array"
   end
 
-  vhost_listen = binds.map{|x| x+":80" }.join(' ')
+  vhost_listen = @binds.map{|x| x+":80" }.join(' ')
 %>
 
 
        ServerAlias *.archive.backend.mirrors.debian.org
 
        #RedirectMatch "^/$" /debian-archive/
-       DocumentRoot <%= archive_root %>/
-       Alias /debian-archive/ <%= archive_root %>/
+       DocumentRoot <%= @archive_root %>/
+       Alias /debian-archive/ <%= @archive_root %>/
 
        ErrorLog /var/log/apache2/archive.debian.org-error.log
        CustomLog /var/log/apache2/archive.debian.org-access.log privacy
 
-       <Directory <%= archive_root %>>
+       <Directory <%= @archive_root %>>
                Require all granted
                Options +Indexes +FollowSymLinks
        </Directory>
index b57df66..1037247 100644 (file)
@@ -3,7 +3,7 @@
 ## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
 ##
 
-<VirtualHost <%= vhost_listen %> >
+<VirtualHost <%= @vhost_listen %> >
        ServerAdmin debian-admin@debian.org
        ServerName debug.mirrors.debian.org
        <% if scope.function_onion_global_service_hostname(['debug.mirrors.debian.org']) -%>
index 339f934..6dda372 100644 (file)
@@ -3,7 +3,7 @@
 ## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
 ##
 
-<VirtualHost <%= vhost_listen %>>
+<VirtualHost <%= @vhost_listen %>>
        ServerAdmin debian-admin@debian.org
        ServerName ftp.debian.org
        ServerAlias debian.anycast-test.mirrors.debian.org
        ServerAlias *.debian.backend.mirrors.debian.org
 
        RedirectMatch "^/$" /debian/
-       Alias /debian/ <%= archive_root %>/
+       Alias /debian/ <%= @archive_root %>/
 
        ErrorLog /var/log/apache2/ftp.debian.org-error.log
        CustomLog /var/log/apache2/ftp.debian.org-access.log privacy
 
-       Use ftp-archive <%= archive_root %>
+       Use ftp-archive <%= @archive_root %>
 
        <IfModule mod_userdir.c>
                UserDir disabled
index 458a83e..a9d4058 100644 (file)
@@ -3,7 +3,7 @@
 ## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
 ##
 
-<VirtualHost <%= vhost_listen %> >
+<VirtualHost <%= @vhost_listen %> >
        ServerAdmin debian-admin@debian.org
        ServerName ftp.ports.debian.org
        <% if scope.function_onion_global_service_hostname(['ftp.ports.debian.org']) -%>
index f505aae..39f6cee 100644 (file)
@@ -4,7 +4,7 @@
 ##
 
 # Need to turn on negotiation_module
-<Directory <%= wwwdo_document_root %>/>
+<Directory <%= @wwwdo_document_root %>/>
   Options +MultiViews +FollowSymLinks +Indexes
   AddHandler type-map var
   # Make sure that the srm.conf directive is commented out.
    ServerAlias www.debian.de
    ServerAlias newwww.deb.at
 
-   DocumentRoot <%= wwwdo_document_root %>/
+   DocumentRoot <%= @wwwdo_document_root %>/
    LogFormat "0.0.0.0 - %u %{[%d/%b/%Y:00:00:00 %z]}t \"%r\" %>s %b \"%{Referer}i\" \"-\" %V" privacy+host
    ErrorLog /var/log/apache2/www-other.debian.org-error.log
    CustomLog /var/log/apache2/www-other.debian.org-access.log privacy+host
    ServerAlias <%= scope.function_onion_global_service_hostname(['www.debian.org']) %>
    <% end %>
 
-   DocumentRoot <%= wwwdo_document_root %>/
+   DocumentRoot <%= @wwwdo_document_root %>/
 
    # CacheNegotiatedDocs: By default, Apache sends Pragma: no-cache with each
    # document that was negotiated on the basis of content. This asks proxy
    RewriteRule ^/devel/debian-volatile/.* /volatile/ [R=301]
 
 # Offer a Redirect to DSA without knowing year #474730
-   RewriteMap dsa txt:<%= wwwdo_document_root %>/security/map-dsa.txt
+   RewriteMap dsa txt:<%= @wwwdo_document_root %>/security/map-dsa.txt
    RewriteRule ^/security/dsa-(\d+)(\..*)? /security/${dsa:$1}$2 [R=301]
 
 # Compatibility after SGML -> DocBook
 # Debian Reference #624239
-   RewriteMap reference txt:<%= wwwdo_document_root %>/doc/map-reference.txt
+   RewriteMap reference txt:<%= @wwwdo_document_root %>/doc/map-reference.txt
    RewriteCond %{DOCUMENT_ROOT}/doc/manuals/debian-reference/ch-support$1 !-f
    RewriteRule ^/doc/manuals/debian-reference/ch-support(.*)  /support$1 [L,R=301]
    RewriteCond %{DOCUMENT_ROOT}/doc/manuals/debian-reference/${reference:$1}$2 -f
 </Macro>
 
 
-<VirtualHost <%= vhost_listen %> >
+<VirtualHost <%= @vhost_listen %> >
    ErrorLog /var/log/apache2/www.debian.org-error.log
    CustomLog /var/log/apache2/www.debian.org-access.log privacy
 
    Use common-www.d.o
 </VirtualHost>
-<VirtualHost <%= vhost_listen_443 %> >
+<VirtualHost <%= @vhost_listen_443 %> >
    ErrorLog /var/log/apache2/www.debian.org-error.log
    CustomLog /var/log/apache2/www.debian.org-access.log privacyssl
 
 </VirtualHost>
 
 
-<VirtualHost <%= vhost_listen %> >
+<VirtualHost <%= @vhost_listen %> >
    Use common-www-other.d.o
 
    ErrorLog /var/log/apache2/www-other.debian.org-error.log
 
    Redirect permanent / http://www.debian.org/
 </VirtualHost>
-<VirtualHost <%= vhost_listen_443 %> >
+<VirtualHost <%= @vhost_listen_443 %> >
    Use common-www-other.d.o
 
    CustomLog /var/log/apache2/www-other-access.log privacyssl
    Use common-debian-service-ssl debian.org
    Use common-ssl-HSTS
 </VirtualHost>
+# vim:set syn=apache:
index 1293d38..ff67004 100644 (file)
@@ -1,4 +1,4 @@
-<%- if hostname == "sibelius" then -%>
+<%- if @hostname == "sibelius" then -%>
 # use ipv4
 ssh_options="-oAddressFamily=inet"
 <%- end %>
index 5b2eb4d..9a3e83c 100644 (file)
@@ -1,6 +1,6 @@
 # puppet maintained
 <Macro common-dsa-vhost-https-redirect $name>
-       <VirtualHost <%= vhost_listen %> >
+       <VirtualHost <%= @vhost_listen %> >
                ServerName $name
                ServerAdmin debian-admin@lists.debian.org
 
@@ -27,7 +27,7 @@
                Require all granted
        </Directory>
 
-       Header set Surrogate-Key <%= hostname %>
+       Header set Surrogate-Key <%= @hostname %>
 
        AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css
 
@@ -35,7 +35,7 @@
 </Macro>
 
 <Macro static-vhost-plain-$name>
-       <VirtualHost <%= vhost_listen %>>
+       <VirtualHost <%= @vhost_listen %>>
                ServerName $name
 
                ErrorLog /var/log/apache2/$name-error.log
@@ -46,7 +46,7 @@
 </Macro>
 
 <Macro static-vhost-onion-$name $onion>
-       <VirtualHost <%= vhost_listen %>>
+       <VirtualHost <%= @vhost_listen %>>
                ServerName $onion
 
                ErrorLog /var/log/apache2/$name-error.log
@@ -57,7 +57,7 @@
 </Macro>
 
 <Macro static-vhost-ssl-$name>
-       <VirtualHost <%= vhost_listen_443 %>>
+       <VirtualHost <%= @vhost_listen_443 %>>
                ServerName $name
 
                ErrorLog /var/log/apache2/$name-error.log
index 7d0ab01..9dca69c 100644 (file)
@@ -1,6 +1,6 @@
 <% if scope.function_has_static_component(['planet.debian.org']) -%>
 
-<Virtualhost <%= vhost_listen %> >
+<Virtualhost <%= @vhost_listen %> >
        ServerName planet.debian.org
        ServerAlias planet.debian.net planeta.debian.net planet-backend.debian.org planet-fastly.debian.org planet-maxcdn.debian.org
        <% if scope.function_onion_global_service_hostname(['planet.debian.org']) -%>
index b035fed..b9df975 100644 (file)
@@ -14,7 +14,7 @@
        Redirect /debian-security/  http://cdn-fastly.deb.debian.org/debian-security/
 </Macro>
 
-<VirtualHost <%= vhost_listen_443 %> >
+<VirtualHost <%= @vhost_listen_443 %> >
        ServerName deb.debian.org
 
        ErrorLog /var/log/apache2/deb.debian.org-error.log
@@ -36,7 +36,7 @@
                Require all granted
        </Directory>
 
-       Header set Surrogate-Key <%= hostname %>
+       Header set Surrogate-Key <%= @hostname %>
 
        AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css
 
@@ -240,7 +240,7 @@ lines.join("\n")
 # www.backports.org is the historical place for the backports
 # website and archive.  It is now a CNAME to backports.debian.org:
 # redirect http requests.
-<VirtualHost <%= vhost_listen %> >
+<VirtualHost <%= @vhost_listen %> >
        ServerName www.backports.org
        ServerAlias lists.backports.org
        ServerAdmin debian-admin@debian.org
@@ -248,27 +248,27 @@ lines.join("\n")
 </VirtualHost>
 
 ######################
-<VirtualHost <%= vhost_listen %> >
+<VirtualHost <%= @vhost_listen %> >
        ServerName www.debian-ports.org
        ServerAlias debian-ports.org
        ServerAdmin debian-admin@debian.org
        RedirectPermanent / https://www.ports.debian.org/
 </VirtualHost>
 
-<VirtualHost <%= vhost_listen %> >
+<VirtualHost <%= @vhost_listen %> >
        ServerName ports.debian.org
        ServerAlias ports.debian.net
        ServerAdmin debian-admin@debian.org
        RedirectPermanent / https://www.ports.debian.org/
 </VirtualHost>
 
-<VirtualHost <%= vhost_listen %> >
+<VirtualHost <%= @vhost_listen %> >
        ServerName incoming.debian-ports.org
        ServerAdmin debian-admin@debian.org
        RedirectPermanent / http://incoming.ports.debian.org/
 </VirtualHost>
 
-<VirtualHost <%= vhost_listen %> >
+<VirtualHost <%= @vhost_listen %> >
        ServerName ftp.debian-ports.org
        ServerAdmin debian-admin@debian.org
        RedirectPermanent /archive http://www.ports.debian.org
@@ -277,7 +277,7 @@ lines.join("\n")
        RedirectPermanent / http://ftp.ports.debian.org/
 </VirtualHost>
 
-<VirtualHost <%= vhost_listen %> >
+<VirtualHost <%= @vhost_listen %> >
        ServerName video.debian.net
        ServerAdmin debian-admin@debian.org
        Redirect / http://meetings-archive.debian.net/pub/debian-meetings/
@@ -286,7 +286,7 @@ lines.join("\n")
 # historical sites
 ##################
 # now only redirects remain
-<VirtualHost <%= vhost_listen %> >
+<VirtualHost <%= @vhost_listen %> >
        ServerName women.debian.org
        ServerAdmin debian-admin@debian.org
 
@@ -303,26 +303,26 @@ lines.join("\n")
        RedirectPermanent /profiles/ http://www.debian.org/women/profiles/
 </VirtualHost>
 
-<VirtualHost <%= vhost_listen %> >
+<VirtualHost <%= @vhost_listen %> >
        ServerName volatile.debian.org
        ServerAlias volatile-master.debian.org
        ServerAdmin debian-admin@debian.org
        RedirectPermanent / http://www.debian.org/volatile/
 </VirtualHost>
 
-<VirtualHost <%= vhost_listen %> >
+<VirtualHost <%= @vhost_listen %> >
        ServerName ftp-master.metadata.debian.org
        ServerAdmin debian-admin@debian.org
        RedirectPermanent / http://metadata.ftp-master.debian.org/
 </VirtualHost>
 
-<VirtualHost <%= vhost_listen %> >
+<VirtualHost <%= @vhost_listen %> >
        ServerName backports-master.debian.org
        ServerAdmin debian-admin@debian.org
        RedirectPermanent / https://backports.debian.org/
 </VirtualHost>
 
-<VirtualHost <%= vhost_listen %> >
+<VirtualHost <%= @vhost_listen %> >
        ServerName manpages.debian.net
        ServerAdmin debian-admin@debian.org
        Redirect / https://manpages.debian.org/
index d27bcc4..a04eeae 100644 (file)
@@ -14,7 +14,7 @@ strict modes = false
 
 [debian]
   path = /srv/mirrors/debian/
-<%- unless has_variable?("has_srv_mirrors_debian") && has_srv_mirrors_debian == "true" -%>
+<%- unless has_variable?("has_srv_mirrors_debian") && @has_srv_mirrors_debian -%>
   list = no
 <%- end -%>
   comment = Debian archive (contact mirrors@debian.org for access; see https://www.debian.org/mirror/size for size)
@@ -23,7 +23,7 @@ strict modes = false
 
 [debian-debug]
   path = /srv/mirrors/debian-debug/
-<%- unless has_variable?("has_srv_mirrors_debian_debug") && has_srv_mirrors_debian_debug == "true" -%>
+<%- unless has_variable?("has_srv_mirrors_debian_debug") && @has_srv_mirrors_debian_debug -%>
   list = no
 <%- end -%>
   comment = Debug packages for Debian archive (contact mirrors@debian.org for access)
@@ -32,7 +32,7 @@ strict modes = false
 
 [debian-ports]
   path = /srv/mirrors/debian-ports/
-<%- unless has_variable?("has_srv_mirrors_debian_debug") && has_srv_mirrors_debian_debug == "true" -%>
+<%- unless has_variable?("has_srv_mirrors_debian_debug") && @has_srv_mirrors_debian_debug -%>
   list = no
 <%- end -%>
   comment = Debian ports archive (contact mirrors@debian.org for access)
@@ -41,7 +41,7 @@ strict modes = false
 
 [debian-security]
   path = /srv/mirrors/debian-security/
-<%- unless has_variable?("has_srv_mirrors_debian_security") && has_srv_mirrors_debian_security == "true" -%>
+<%- unless has_variable?("has_srv_mirrors_debian_security") && @has_srv_mirrors_debian_security -%>
   list = no
 <%- end -%>
   comment = Debian security archive (contact mirrors@debian.org for access)
index de01c02..e81cbe3 100644 (file)
@@ -4,25 +4,25 @@
 ##
 
 <%
-  vhost_listen = [ (bind != '') ? "#{bind}" : "*",  (bind6 != '') ? "#{bind6}" : "*"].uniq
-  vhost_listen_443 = [ (bind != '') ? "#{bind}:443" : "*:443",  (bind6 != '') ? "[#{bind6}]:443" : "*:443"].uniq
+  vhost_listen = [ (@bind != '') ? "#{@bind}" : "*",  (@bind6 != '') ? "#{@bind6}" : "*"].uniq
+  vhost_listen_443 = [ (@bind != '') ? "#{@bind}:443" : "*:443",  (@bind6 != '') ? "[#{@bind6}]:443" : "*:443"].uniq
 %>
 
 <%=
 lines = []
 vhost_listen.each do |bind|
-   lines << "Use common-debian-service-https-redirect \"#{bind}\" \"#{syncproxy_name}\""
+   lines << "Use common-debian-service-https-redirect \"#{bind}\" \"#{@syncproxy_name}\""
 end
 lines.join("\n")
 
 %>
 <Virtualhost <%= vhost_listen_443.join(' ') %> >
-   ServerName <%= syncproxy_name %>
+   ServerName <%= @syncproxy_name %>
    DocumentRoot /srv/www/syncproxy.debian.org/htdocs
 
-   Use common-debian-service-ssl <%= syncproxy_name %>
+   Use common-debian-service-ssl <%= @syncproxy_name %>
    Use common-ssl-HSTS
-   Use http-pkp-<%= syncproxy_name %>
+   Use http-pkp-<%= @syncproxy_name %>
 
    <Directory /srv/www/syncproxy.debian.org/htdocs>
       Require all granted
@@ -35,7 +35,7 @@ lines.join("\n")
 lines = []
 %w{debian debian-debug debian-ports debian-security}.each do |archive|
   varname = 'has_srv_mirrors_' + archive.gsub(/[\/-]/,'_')
-  if has_variable?(varname) and (eval(varname)) == 'true'
+  if has_variable?(varname) and (eval("@"+varname))
     lines << "  Alias /#{archive}/project/trace/ /srv/mirrors/#{archive}/project/trace/"
     lines << "  <Directory /srv/mirrors/#{archive}/project/trace/>"
     lines << "    Require all granted"
index 062731e..ef9fdfc 100644 (file)
@@ -1,13 +1,13 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
 <HTML>
 <HEAD>
-   <TITLE>Welcome to <%= syncproxy_name %>!</TITLE>
+   <TITLE>Welcome to <%= @syncproxy_name %>!</TITLE>
 </HEAD>
 <BODY>
 
-<H1>Welcome to <%= syncproxy_name %>!</H1>
+<H1>Welcome to <%= @syncproxy_name %>!</H1>
 
-This is <%= syncproxy_name %>, a syncproxy run by and for the <a
+This is <%= @syncproxy_name %>, a syncproxy run by and for the <a
 href="https://www.debian.org/">Debian Project</a> to aid in mirroring
 our software.  Consult <a href="https://www.debian.org/mirror/">the
 mirrors section of the Debian website</a> for more information.
@@ -20,7 +20,7 @@ This syncproxy contains copies of the following archives.
 lines = []
 %w{debian debian-debug debian-ports debian-security}.each do |archive|
   varname = 'has_srv_mirrors_' + archive.gsub(/[\/-]/,'_')
-  if has_variable?(varname) and (eval(varname)) == 'true'
+  if has_variable?(varname) and (eval("@"+varname))
     lines << "<li>#{archive} [<a href=\"/#{archive}/project/trace/\">trace directory</a>]</li>"
   end
 end
index ab47a1a..04c1e20 100644 (file)
@@ -1,11 +1,11 @@
 define rsync::site (
        $bind='',
        $bind6='',
-       $source='',
-       $content='',
+       $source=undef,
+       $content=undef,
        $max_clients=200,
        $ensure=present,
-       $sslname='',
+       $sslname=undef,
        $sslport=1873
 ){
 
@@ -62,7 +62,7 @@ define rsync::site (
                }
        }
 
-       if $sslname != '' {
+       if $sslname {
                file { "/etc/rsyncd-${name}-stunnel.conf":
                        content => template('rsync/rsyncd-stunnel.conf.erb'),
                        require => File["/etc/ssl/debian/certs/${sslname}.crt-chained"],
index f57d67a..ffb7ba8 100644 (file)
@@ -1,5 +1,5 @@
-cert = /etc/ssl/debian/certs/<%= sslname %>.crt-chained
-key = /etc/ssl/private/<%= sslname %>.key
+cert = /etc/ssl/debian/certs/<%= @sslname %>.crt-chained
+key = /etc/ssl/private/<%= @sslname %>.key
 
 debug = notice
 
@@ -8,4 +8,4 @@ socket = a:SO_LINGER=1:60
 socket = a:SO_KEEPALIVE=1
 
 exec = /usr/bin/rsync
-execargs = rsync --daemon --config=/etc/rsyncd-<%= name %>.conf
+execargs = rsync --daemon --config=/etc/rsyncd-<%= @name %>.conf
index 018a05e..93116ac 100644 (file)
@@ -835,7 +835,7 @@ SyslogSeverity=alert
 #
 # SetDefault = no
 
-<% if @lsbmajdistrelease >= '9' -%>
+<% if scope.call_function('versioncmp', [@lsbmajdistrelease, '9']) >= 0 -%>
 [PortCheck]
 PortCheckActive=0
 <% end -%>
index 14bb914..7c5e008 100644 (file)
@@ -33,12 +33,10 @@ class schroot {
                source  => 'puppet:///modules/schroot/schroot-setup.d/99porterbox-extra-sources',
                require => Package['schroot'],
        }
-       if ($::lsbmajdistrelease >= 8) {
-               file { '/etc/schroot/setup.d/99builddsourceslist':
-                       mode    => '0555',
-                       source  => 'puppet:///modules/schroot/schroot-setup.d/99builddsourceslist',
-                       require => Package['schroot'],
-               }
+       file { '/etc/schroot/setup.d/99builddsourceslist':
+               mode    => '0555',
+               source  => 'puppet:///modules/schroot/schroot-setup.d/99builddsourceslist',
+               require => Package['schroot'],
        }
 
        file { '/usr/local/sbin/setup-dchroot':
index 56a8756..7fe230f 100644 (file)
@@ -18,7 +18,7 @@ dev           /dev/fd         fdescfs rw              0       0
 /dev/pts       /dev/pts        none    rw,bind         0       0
 tmpfs-shm      /dev/shm        tmpfs   defaults,size=64m       0 0
 
-<%- if has_variable?("has_srv_build_trees") && has_srv_build_trees == "true" -%>
+<%- if has_variable?("has_srv_build_trees") && @has_srv_build_trees -%>
 /srv/build-trees       /build  none    rw,bind         0       0
 
 <% end %>
index fc576f8..56537e4 100644 (file)
@@ -37,7 +37,7 @@ class ssh {
                content => template('ssh/authorized_keys.erb'),
        }
 
-       if ($::lsbmajdistrelease >= '8') {
+       if (versioncmp($::lsbmajdistrelease, '8') >= 0) {
                if ! $has_etc_ssh_ssh_host_ed25519_key {
                        exec { 'create-ed25519-host-key':
                                command => 'ssh-keygen -f /etc/ssh/ssh_host_ed25519_key -q -P "" -t ed25519',
index 7a8ff87..d2ad6b3 100644 (file)
@@ -24,7 +24,7 @@ extraports
 Protocol 2
 # HostKeys for protocol version 2
 HostKey /etc/ssh/ssh_host_rsa_key
-<%- if has_variable?("has_etc_ssh_ssh_host_ed25519_key") && @has_etc_ssh_ssh_host_ed25519_key == "true" -%>
+<%- if has_variable?("has_etc_ssh_ssh_host_ed25519_key") && @has_etc_ssh_ssh_host_ed25519_key -%>
 HostKey /etc/ssh/ssh_host_ed25519_key
 <% end %>
 #Privilege Separation is turned on for security
index 778a5b8..737b9f5 100644 (file)
@@ -1,13 +1,13 @@
 <%=
   out = ""
-  fn = "/etc/puppet/modules/ssl/files/servicecerts/#{name}.crt"
+  fn = "/etc/puppet/modules/ssl/files/servicecerts/#{@name}.crt"
   if File.exist?(fn) then
     out = File.read(fn)
 
-    chain = "/etc/puppet/modules/ssl/files/chains/#{name}.crt"
+    chain = "/etc/puppet/modules/ssl/files/chains/#{@name}.crt"
     out += File.exist?(chain) ? ("\n" + File.read(chain)) : ''
   else
-    fn = "/etc/puppet/modules/ssl/files/from-letsencrypt/#{name}.crt-chained"
+    fn = "/etc/puppet/modules/ssl/files/from-letsencrypt/#{@name}.crt-chained"
     out = File.read(fn)
   end
   out
index 2fbace0..75b3428 100644 (file)
@@ -1,24 +1,24 @@
 <%=
   out = ""
-  fn = "/etc/puppet/modules/ssl/files/keys/#{name}.crt"
+  fn = "/etc/puppet/modules/ssl/files/keys/#{@name}.crt"
   if File.exist?(fn) then
     out = File.read(fn)
   else
-    fn = "/etc/puppet/modules/ssl/files/from-letsencrypt/#{name}.key"
+    fn = "/etc/puppet/modules/ssl/files/from-letsencrypt/#{@name}.key"
     out = File.read(fn)
   end
   out
 %>
 <%=
   out = ""
-  fn = "/etc/puppet/modules/ssl/files/servicecerts/#{name}.crt"
+  fn = "/etc/puppet/modules/ssl/files/servicecerts/#{@name}.crt"
   if File.exist?(fn) then
     out = File.read(fn)
 
-    chain = "/etc/puppet/modules/ssl/files/chains/#{name}.crt"
+    chain = "/etc/puppet/modules/ssl/files/chains/#{@name}.crt"
     out += File.exist?(chain) ? ("\n" + File.read(chain)) : ''
   else
-    fn = "/etc/puppet/modules/ssl/files/from-letsencrypt/#{name}.crt-chained"
+    fn = "/etc/puppet/modules/ssl/files/from-letsencrypt/#{@name}.crt-chained"
     out = File.read(fn)
   end
   out
index 67cf7fd..7cf1a6f 100644 (file)
@@ -35,7 +35,7 @@ socket = a:SO_LINGER=1:60
 socket = a:SO_KEEPALIVE=1
 
 [<%= @name %>-server]
-accept = <%= @accept =~ /:/ ? @accept : ":::#{accept}" %>
+accept = <%= @accept =~ /:/ ? @accept : ":::#{@accept}" %>
 connect = <%= @connect %>
 <%- if @local -%>
 local = <%= @local %>
index 7065c78..761a570 100644 (file)
@@ -16,7 +16,7 @@
 #Servers=0.debian.pool.ntp.org 1.debian.pool.ntp.org 2.debian.pool.ntp.org 3.debian.pool.ntp.org
 <%=
   servers = []
-  localtimeservers.each do |node|
+  @localtimeservers.each do |node|
     scope.lookupvar('site::allnodeinfo')[node]['ipHostNumber'].each do |addr|
         servers << addr
     end