From 09ab0b0f5d21744817de20b116633bd108272ab8 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Thu, 2 Sep 2010 17:05:37 +0200 Subject: [PATCH] Revert "We use "keyinfo" in all kinda of places. Rename it to something more generic" This reverts commit d7475f90c56697e9589e1386ced135498df68c81. --- manifests/site.pp | 3 +- modules/exim/templates/manualroute.erb | 4 +-- modules/ferm/templates/defs.conf.erb | 28 +++++++++---------- .../munin-node/templates/munin-node.conf.erb | 2 +- modules/nagios/templates/inc-debian.org.erb | 2 +- .../named/templates/named.conf.options.erb | 2 +- .../templates/authorized_keys.erb | 2 +- modules/ssh/templates/authorized_keys.erb | 6 ++-- 8 files changed, 25 insertions(+), 24 deletions(-) diff --git a/manifests/site.pp b/manifests/site.pp index f040683ca..9b00836e8 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -17,7 +17,8 @@ node default { $localinfo = yamlinfo('*', "/etc/puppet/modules/debian-org/misc/local.yaml") $nodeinfo = nodeinfo($fqdn, "/etc/puppet/modules/debian-org/misc/local.yaml") $hoster = whohosts($nodeinfo, "/etc/puppet/modules/debian-org/misc/hoster.yaml") - $ldapall = allnodeinfo("sshRSAHostKey", "ipHostNumber", "mXRecord") + $keyinfo = allnodeinfo("sshRSAHostKey", "ipHostNumber") + $mxinfo = allnodeinfo("mXRecord") notice("hoster for ${fqdn} is ${hoster}") include munin-node diff --git a/modules/exim/templates/manualroute.erb b/modules/exim/templates/manualroute.erb index 07ddf5514..2b84b4ede 100644 --- a/modules/exim/templates/manualroute.erb +++ b/modules/exim/templates/manualroute.erb @@ -19,8 +19,8 @@ when 'spohr.debian.org', 'draghi.debian.org', 'merikanto.debian.org' then end mxregex = Regexp.new('^\d+\s+(.*)\.$') -ldapall.keys.sort.each do |host| - ldapall[host]['mXRecord'].each do |mx| +mxinfo.keys.sort.each do |host| + mxinfo[host]['mXRecord'].each do |mx| mxmatch = mxregex.match(mx) if mxmatches.include?(mxmatch[1]) route = host + ":\t\t" + host diff --git a/modules/ferm/templates/defs.conf.erb b/modules/ferm/templates/defs.conf.erb index a68420977..c39b03d65 100644 --- a/modules/ferm/templates/defs.conf.erb +++ b/modules/ferm/templates/defs.conf.erb @@ -19,7 +19,7 @@ mailrelay = [] localinfo.keys.sort.each do |node| if localinfo[node]['mailrelay'] - ldapall[node]['ipHostNumber'].each do |ip| + keyinfo[node]['ipHostNumber'].each do |ip| next if ip =~ /:/ mailrelay << ip end @@ -33,7 +33,7 @@ mailrelay = [] localinfo.keys.sort.each do |node| if localinfo[node]['mailrelay'] - ldapall[node]['ipHostNumber'].each do |ip| + keyinfo[node]['ipHostNumber'].each do |ip| next if ip =~ /\./ mailrelay << ip end @@ -49,7 +49,7 @@ nagii = [] localinfo.keys.sort.each do |node| if localinfo[node]['nagiosmaster'] or localinfo[node]['extranrpeclient'] - ldapall[node]['ipHostNumber'].each do |ip| + keyinfo[node]['ipHostNumber'].each do |ip| next if ip =~ /:/ nagii << ip end @@ -63,7 +63,7 @@ nagii = [] localinfo.keys.sort.each do |node| if localinfo[node]['nagiosmaster'] or localinfo[node]['extranrpeclient'] - ldapall[node]['ipHostNumber'].each do |ip| + keyinfo[node]['ipHostNumber'].each do |ip| next if ip =~ /\./ nagii << ip end @@ -79,7 +79,7 @@ munins = [] localinfo.keys.sort.each do |node| if localinfo[node]['muninmaster'] - ldapall[node]['ipHostNumber'].each do |ip| + keyinfo[node]['ipHostNumber'].each do |ip| next if ip =~ /:/ munins << ip end @@ -93,7 +93,7 @@ munins = [] localinfo.keys.sort.each do |node| if localinfo[node]['muninmaster'] - ldapall[node]['ipHostNumber'].each do |ip| + keyinfo[node]['ipHostNumber'].each do |ip| next if ip =~ /\./ munins << ip end @@ -109,7 +109,7 @@ dbs = [] localinfo.keys.sort.each do |node| if localinfo[node]['dbmaster'] - ldapall[node]['ipHostNumber'].each do |ip| + keyinfo[node]['ipHostNumber'].each do |ip| next if ip =~ /\./ dbs << ip end @@ -123,7 +123,7 @@ dbs = [] localinfo.keys.sort.each do |node| if localinfo[node]['dbmaster'] - ldapall[node]['ipHostNumber'].each do |ip| + keyinfo[node]['ipHostNumber'].each do |ip| next if ip =~ /:/ dbs << ip end @@ -137,9 +137,9 @@ @def $HOST_DEBIAN_V4 = (<%= dbs = [] - ldapall.keys.sort.each do |node| - next unless ldapall[node].has_key?('ipHostNumber') - ldapall[node]['ipHostNumber'].each do |ip| + keyinfo.keys.sort.each do |node| + next unless keyinfo[node].has_key?('ipHostNumber') + keyinfo[node]['ipHostNumber'].each do |ip| next if ip =~ /:/ dbs << ip end @@ -150,9 +150,9 @@ @def $HOST_DEBIAN_V6 = (<%= dbs = [] - ldapall.keys.sort.each do |node| - next unless ldapall[node].has_key?('ipHostNumber') - ldapall[node]['ipHostNumber'].each do |ip| + keyinfo.keys.sort.each do |node| + next unless keyinfo[node].has_key?('ipHostNumber') + keyinfo[node]['ipHostNumber'].each do |ip| next if ip =~ /\./ dbs << ip end diff --git a/modules/munin-node/templates/munin-node.conf.erb b/modules/munin-node/templates/munin-node.conf.erb index 73eab95e6..231b1a25a 100644 --- a/modules/munin-node/templates/munin-node.conf.erb +++ b/modules/munin-node/templates/munin-node.conf.erb @@ -42,7 +42,7 @@ ignore_file \.rpm(save|new)$ str = '' localinfo.keys.sort.each do |node| if localinfo[node]['muninmaster'] - ldapall[node]['ipHostNumber'].each do |ip| + keyinfo[node]['ipHostNumber'].each do |ip| str += "allow ^" + ip.split('.').join('\.') + "$\n" end end diff --git a/modules/nagios/templates/inc-debian.org.erb b/modules/nagios/templates/inc-debian.org.erb index b3ce35859..bf6c2f95d 100644 --- a/modules/nagios/templates/inc-debian.org.erb +++ b/modules/nagios/templates/inc-debian.org.erb @@ -7,7 +7,7 @@ nagii = [] localinfo.keys.sort.each do |node| if localinfo[node]['nagiosmaster'] or localinfo[node]['extranrpeclient'] - nagii << ldapall[node]['ipHostNumber'] + nagii << keyinfo[node]['ipHostNumber'] end end diff --git a/modules/named/templates/named.conf.options.erb b/modules/named/templates/named.conf.options.erb index 8d6027830..84469dfff 100644 --- a/modules/named/templates/named.conf.options.erb +++ b/modules/named/templates/named.conf.options.erb @@ -8,7 +8,7 @@ acl Nagios { str = '' localinfo.keys.sort.each do |node| if localinfo[node]['nagiosmaster'] - ldapall[node]['ipHostNumber'].each do |ip| + keyinfo[node]['ipHostNumber'].each do |ip| str += "\t" + ip + "/32;\n" end end diff --git a/modules/portforwarder/templates/authorized_keys.erb b/modules/portforwarder/templates/authorized_keys.erb index d119bf2fe..985f367c7 100644 --- a/modules/portforwarder/templates/authorized_keys.erb +++ b/modules/portforwarder/templates/authorized_keys.erb @@ -29,7 +29,7 @@ config.each_pair do |sourcehost, services| if allowed_ports.length > 0 sshkey = getportforwarderkey(sourcehost) - remote_ip = ldapall[sourcehost]['ipHostNumber'].join(',') + remote_ip = keyinfo[sourcehost]['ipHostNumber'].join(',') local_bind = '127.101.%d.%d'%[ (sourcehost.hash / 256 % 256), sourcehost.hash % 256 ] lines << "# from #{sourcehost}" diff --git a/modules/ssh/templates/authorized_keys.erb b/modules/ssh/templates/authorized_keys.erb index 71b604cd7..ba6f9f6ff 100644 --- a/modules/ssh/templates/authorized_keys.erb +++ b/modules/ssh/templates/authorized_keys.erb @@ -36,9 +36,9 @@ ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAgEAuGJnElqbhgLtmJp/de8s42cAwKrkAhFq5u8EAkauEv6B <%= machine_keys = case fqdn when "bartok.debian.org", "beethoven.debian.org" then out = '' - ldapall.keys.sort.each do |node| - out += '# ' + ldapall[node]['hostname'].to_s + ' -command="/usr/lib/da-backup/da-backup-ssh-wrap ' + ldapall[node]['hostname'].to_s + '",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,from="' + keyinfo[node]['ipHostNumber'].join(',') + '" ' + keyinfo[node]['sshRSAHostKey'].to_s + ' + keyinfo.keys.sort.each do |node| + out += '# ' + keyinfo[node]['hostname'].to_s + ' +command="/usr/lib/da-backup/da-backup-ssh-wrap ' + keyinfo[node]['hostname'].to_s + '",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,from="' + keyinfo[node]['ipHostNumber'].join(',') + '" ' + keyinfo[node]['sshRSAHostKey'].to_s + ' ' end -- 2.20.1