puppetmaster -> wheezy, Pt I
authorPeter Palfrader <peter@palfrader.org>
Wed, 29 May 2013 09:32:56 +0000 (09:32 +0000)
committerPeter Palfrader <peter@palfrader.org>
Wed, 29 May 2013 09:32:56 +0000 (09:32 +0000)
modules/debian-org/misc/hoster.yaml
modules/ferm/templates/me.conf.erb
modules/nagios/templates/obsolete-packages-ignore.d-hostspecific.erb
modules/puppetmaster/files/hiera.yaml
modules/puppetmaster/lib/puppet/parser/functions/allnodeinfo.rb
modules/puppetmaster/lib/puppet/parser/functions/entropy_provider.rb
modules/puppetmaster/lib/puppet/parser/functions/nodeinfo.rb
modules/puppetmaster/lib/puppet/parser/functions/yamlinfo.rb
modules/puppetmaster/manifests/init.pp
modules/site/manifests/params.pp [deleted file]
modules/site/templates/aptrepo.erb

index 3a8bfaa..48e80b7 100644 (file)
@@ -150,7 +150,7 @@ ubcece:
     - 206.12.19.0/24
   searchpaths: [debprivate-ubc.debian.org]
   mirror-debian: http://mirror-ubc.debian.org/debian/
     - 206.12.19.0/24
   searchpaths: [debprivate-ubc.debian.org]
   mirror-debian: http://mirror-ubc.debian.org/debian/
-  nameservers: [206.12.19.214, 2607:f8f0:610:4000:224:81ff:fea7:e952, 206.12.19.20, 2607:f8f0:610:4000:218:feff:fe76:2ed0, 206.12.19.21, 2607:f8f0:610:4000:21c:c4ff:fee5:e890]
+  nameservers: ['206.12.19.214', '2607:f8f0:610:4000:224:81ff:fea7:e952', '206.12.19.20', '2607:f8f0:610:4000:218:feff:fe76:2ed0', '206.12.19.21', '2607:f8f0:610:4000:21c:c4ff:fee5:e890']
 ugent:
   netrange:
     - 157.193.0.0/16
 ugent:
   netrange:
     - 157.193.0.0/16
index 69b8fa5..a6aebec 100644 (file)
@@ -6,7 +6,7 @@
 <%=
 out = []
 
 <%=
 out = []
 
-restricted_purposes = {'kvm host', 'central syslog server', 'puppet master', 'jumphost'}
+restricted_purposes = ['kvm host', 'central syslog server', 'puppet master', 'jumphost']
 restrict_ssh = %w{lebrun geo1 geo2 geo3 beethoven tchaikovsky schroeder draghi}
 
 if (scope.lookupvar('site::nodeinfo')['ldap'].has_key?('purpose')) then
 restrict_ssh = %w{lebrun geo1 geo2 geo3 beethoven tchaikovsky schroeder draghi}
 
 if (scope.lookupvar('site::nodeinfo')['ldap'].has_key?('purpose')) then
index f50eef9..813d7e6 100644 (file)
@@ -1,42 +1,38 @@
 ##
 ## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
 ##
 ## 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
+## USE then git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
 ##
 
 <%=
 ignore = []
 case fqdn
 ##
 
 <%=
 ignore = []
 case fqdn
-when "bellini.debian.org":              ignore << "mcelog"
-when "cilea.debian.org":                ignore << "/freeswitch.*/"
-when /draghi.debian.org/:               ignore << %w{userdir-ldap userdir-ldap-cgi libheimdal-kadm5-perl django-ldapdb}
-when /orff.debian.org/:                 ignore << %w{libnet-dns-sec-perl libnet-dns-zone-parser-perl}
-when /(zandonai|zelenka).debian.org/:   ignore << %w{samhain zabbix-agent rrdcollect}
-when /zappa.debian.org/:                ignore << %w{samhain}
-when /(mayer|corelli).debian.org/: ignore << "linux-base"
-when /(alkman|caballero|merulo|mundy).debian.org/: ignore << "samhain"
-when "franck.debian.org":               ignore << %w{python-apt}
-when /(abel|arnold|alain|alwyn|antheil|arne).debian.org/: ignore << %w{flash-kernel linux-firmware-image}
-when /harris.debian.org/:               ignore << %w{flash-kernel kernel linux-firmware-image}
-when /(hasse|hebden|henze|hildegard|howells|hummel|hoiby).debian.org/: ignore << %w{flash-kernel kernel linux-firmware-image schroot schroot-common}
-when /(parry|partch|piston).debian.org/: ignore << "yaboot"
-
-when "grieg.debian.org":                ignore << %w{dpkg}
-when "blavet.debian.org":               ignore << %w{dpkg-dev libdpkg-perl dpkg}
-when "handel.debian.org":               ignore << %w{puppet-dashboard}
-when "reger.debian.org":                ignore << %w{librt-extension-commandbymail-perl}
-when /(pasquini|tristano).debian.org/:  ignore << %w{ganeti-instance-image}
+when "bellini.debian.org" then                                 ignore << "mcelog"
+when "cilea.debian.org" then                                   ignore << "/freeswitch.*/"
+when /draghi.debian.org/ then                                  ignore << %w{userdir-ldap userdir-ldap-cgi libheimdal-kadm5-perl django-ldapdb}
+when /orff.debian.org/ then                                    ignore << %w{libnet-dns-sec-perl libnet-dns-zone-parser-perl}
+when /(zandonai|zelenka).debian.org/ then                      ignore << %w{samhain zabbix-agent rrdcollect}
+when /zappa.debian.org/ then                                   ignore << %w{samhain}
+when /(mayer|corelli).debian.org/ then                         ignore << "linux-base"
+when /(alkman|caballero|merulo|mundy).debian.org/ then         ignore << "samhain"
+when "franck.debian.org" then                                  ignore << %w{python-apt}
+when /(abel|arnold|alain|alwyn|antheil|arne).debian.org/ then  ignore << %w{flash-kernel linux-firmware-image}
+when /harris.debian.org/ then                                  ignore << %w{flash-kernel kernel linux-firmware-image}
+when /(hasse|hebden|henze|hildegard|howells|hummel|hoiby).debian.org/ then ignore << %w{flash-kernel kernel linux-firmware-image}
+when /(parry|partch|piston).debian.org/ then                   ignore << "yaboot"
+when "grieg.debian.org" then                                   ignore << %w{dpkg}
+when "blavet.debian.org" then                                  ignore << %w{dpkg-dev libdpkg-perl dpkg}
+when "handel.debian.org" then                                  ignore << %w{puppet-dashboard}
+when "reger.debian.org" then                                   ignore << %w{librt-extension-commandbymail-perl}
+when /(pasquini|tristano).debian.org/ then                     ignore << %w{ganeti-instance-image}
 end
 
 case fqdn
 end
 
 case fqdn
-when /geo[123].debian.org/: ignore << %w{geoip-database}
+when /geo[123].debian.org/ then                    ignore << %w{geoip-database}
 end
 
 if fqdn == "arne.debian.org"
 end
 
 if fqdn == "arne.debian.org"
-       ignore << %w{/linux-headers-.*/}
+    ignore << %w{/linux-headers-.*/}
 end
 end
-#case fqdn
-#when /(draghi|orff|ravel|klecker|geo[123]).debian.org/: ignore << %w{libdns69 libdns66 libdns64 bind9 libbind9-60 liblwres60 bind9-host libisccfg62 libisccfg60 libisc62 libisc60 dnsutils bind9utils libisccc60}
-#end
 
 ignore.flatten.join("\n")
 %>
 
 ignore.flatten.join("\n")
 %>
index 54fab8b..216f65f 100644 (file)
@@ -1,8 +1,8 @@
 ---
 :hierarchy:
 ---
 :hierarchy:
-  - %{hoster}
-  - clusters/%{cluster}
-  - common
+  - '%{hoster}'
+  - 'clusters/%{cluster}'
+  - 'common'
 :backends:
   - yaml
 :yaml:
 :backends:
   - yaml
 :yaml:
index 11baf10..012d58e 100644 (file)
@@ -4,7 +4,7 @@ module Puppet::Parser::Functions
       required = args.shift.split()
       optional = args.shift.split()
 
       required = args.shift.split()
       optional = args.shift.split()
 
-      allhosts = function_ldapinfo('*', *(required+optional) )
+      allhosts = function_ldapinfo(['*', *(required+optional) ])
       res = {}
       allhosts.each_pair do |hostname, host|
           # If a returned value doesn't have all the attributes we're searching for, skip
       res = {}
       allhosts.each_pair do |hostname, host|
           # If a returned value doesn't have all the attributes we're searching for, skip
index ef73e5d..19b3366 100644 (file)
@@ -21,7 +21,7 @@ module Puppet::Parser::Functions
         next unless  localinfo[node]['entropy_key']
 
         addresses = allnodeinfo[node]['ipHostNumber']
         next unless  localinfo[node]['entropy_key']
 
         addresses = allnodeinfo[node]['ipHostNumber']
-        thishoster = function_whohosts(addresses, "/etc/puppet/modules/debian-org/misc/hoster.yaml")
+        thishoster = function_whohosts([addresses, "/etc/puppet/modules/debian-org/misc/hoster.yaml"])
         name = thishoster['name']
 
         provider << node
         name = thishoster['name']
 
         provider << node
index 7a02be4..cca270c 100644 (file)
@@ -7,12 +7,12 @@ module Puppet::Parser::Functions
       require '/var/lib/puppet/lib/puppet/parser/functions/ldapinfo.rb'
       require '/var/lib/puppet/lib/puppet/parser/functions/whohosts.rb'
 
       require '/var/lib/puppet/lib/puppet/parser/functions/ldapinfo.rb'
       require '/var/lib/puppet/lib/puppet/parser/functions/whohosts.rb'
 
-      nodeinfo         = function_yamlinfo(host, yamlfile)
-      nodeinfo['ldap'] = function_ldapinfo(host, '*')
+      nodeinfo         = function_yamlinfo([host, yamlfile])
+      nodeinfo['ldap'] = function_ldapinfo([host, '*'])
       unless nodeinfo['ldap']['ipHostNumber']
         raise Puppet::ParseError, "Host #{host} does not have ipHostNumber values in ldap"
       end
       unless nodeinfo['ldap']['ipHostNumber']
         raise Puppet::ParseError, "Host #{host} does not have ipHostNumber values in ldap"
       end
-      nodeinfo['hoster'] = function_whohosts(nodeinfo['ldap']['ipHostNumber'], "/etc/puppet/modules/debian-org/misc/hoster.yaml")
+      nodeinfo['hoster'] = function_whohosts([nodeinfo['ldap']['ipHostNumber'], "/etc/puppet/modules/debian-org/misc/hoster.yaml"])
       nodeinfo['buildd'] = (nodeinfo['ldap']['purpose'].respond_to?('include?') && nodeinfo['ldap']['purpose'].include?('buildd'))
 
       if lookupvar('::mta') == 'exim4'
       nodeinfo['buildd'] = (nodeinfo['ldap']['purpose'].respond_to?('include?') && nodeinfo['ldap']['purpose'].include?('buildd'))
 
       if lookupvar('::mta') == 'exim4'
@@ -39,8 +39,8 @@ module Puppet::Parser::Functions
         end
       end
 
         end
       end
 
-      ns = function_hiera('nameservers')
-      allow_dns_q = function_hiera('allow_dns_query')
+      ns = function_hiera(['nameservers'])
+      allow_dns_q = function_hiera(['allow_dns_query'])
       if ns.empty?
         # no nameservers known for this hoster
         nodeinfo['misc']['resolver-recursive'] = true
       if ns.empty?
         # no nameservers known for this hoster
         nodeinfo['misc']['resolver-recursive'] = true
index cb53ada..8f705c8 100644 (file)
@@ -6,7 +6,7 @@ module Puppet::Parser::Functions
     parser = Puppet::Parser::Parser.new(environment)
     parser.watch_file(yamlfile)
 
     parser = Puppet::Parser::Parser.new(environment)
     parser.watch_file(yamlfile)
 
-    def read_yaml(yaml, host)
+    read_yaml = lambda { |yaml, host|
       results = {}
 
       ['nameinfo', 'footer'].each do |detail|
       results = {}
 
       ['nameinfo', 'footer'].each do |detail|
@@ -40,7 +40,7 @@ module Puppet::Parser::Functions
         end
       end
       return(results)
         end
       end
       return(results)
-    end
+    }
 
     require 'yaml'
     $KCODE = 'utf-8'
 
     require 'yaml'
     $KCODE = 'utf-8'
@@ -52,10 +52,10 @@ module Puppet::Parser::Functions
       Dir.entries('/var/lib/puppet/yaml/node/').each do |fname|
         next unless fname =~ /(.*)\.yaml$/
         host_name = $1
       Dir.entries('/var/lib/puppet/yaml/node/').each do |fname|
         next unless fname =~ /(.*)\.yaml$/
         host_name = $1
-        ret[host_name] = read_yaml(yaml, host_name)
+        ret[host_name] = read_yaml.call(yaml, host_name)
       end
     else
       end
     else
-      ret = read_yaml(yaml, host)
+      ret = read_yaml.call(yaml, host)
     end
 
     return(ret)
     end
 
     return(ret)
index 43432af..f1c567d 100644 (file)
@@ -1,9 +1,7 @@
 class puppetmaster {
 
 class puppetmaster {
 
-       include site::params
-
        package { 'puppetmaster':
        package { 'puppetmaster':
-               ensure => $site::params::puppetversion,
+               ensure => installed,
        }
        file { '/etc/puppet/hiera.yaml':
                source => 'puppet:///modules/puppetmaster/hiera.yaml'
        }
        file { '/etc/puppet/hiera.yaml':
                source => 'puppet:///modules/puppetmaster/hiera.yaml'
diff --git a/modules/site/manifests/params.pp b/modules/site/manifests/params.pp
deleted file mode 100644 (file)
index 211c45f..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-class site::params {
-       $puppetversion = $::hostname ? {
-               handel  => '2.7.18-3~bpo60+1',
-               default => '2.6.2-5+squeeze5',
-       }
-}
index a826fa2..9469d13 100644 (file)
@@ -3,4 +3,4 @@
 ### USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
 ###
 
 ### USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
 ###
 
-deb     <%= scope.lookupvar('url') %>  <%= scope.lookupvar('suite') %> <%= scope.lookupvar('components').to_a.join(' ') %>
+deb     <%= scope.lookupvar('url') %>  <%= scope.lookupvar('suite') %> <%= [scope.lookupvar('components')].flatten.join(' ') %>