From 72082fda0b30e2ab7093126c781032ddee87be6b Mon Sep 17 00:00:00 2001 From: Stephen Gran Date: Sun, 26 Apr 2009 12:45:07 +0100 Subject: [PATCH] A test Signed-off-by: Stephen Gran --- modules/debian-org/misc/nodeinfo.yaml | 35 +++++++++++++++++++++++ modules/debian-org/templates/nodeinfo.erb | 32 +++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 modules/debian-org/misc/nodeinfo.yaml create mode 100644 modules/debian-org/templates/nodeinfo.erb diff --git a/modules/debian-org/misc/nodeinfo.yaml b/modules/debian-org/misc/nodeinfo.yaml new file mode 100644 index 00000000..a16abe96 --- /dev/null +++ b/modules/debian-org/misc/nodeinfo.yaml @@ -0,0 +1,35 @@ +--- +nameinfo: + agnesi.debian.org: Maria Teresa Agnesi (October 17, 1720 - January 19, 1795) + albeniz.debian.org: Isaac Manuel Francisco Albéniz i Pascual (May 29, 1860 - May 18, 1909) + ancina.debian.org: Giovanni Giovenale Ancina (19 October 1545 - August 30, 1604) + arcadelt.debian.org: Jacques Arcadelt (also Jacob Arcadelt) (?1507 - October 14, 1568) + argento.debian.org: Dominick Argento (b. October 27, 1927) + bartok.debian.org: Béla Viktor János Bartók (March 25, 1881 - September 26, 1945) + brahms.debian.org: Johannes Brahms (May 7, 1833 - April 3, 1897) + carver.debian.org: Robert Carver (ca.1485 – ca.1570) + chopin.debian.org: Frédéric Chopin (1 March 1810 - 17 October 1849) + dijkstra.debian.org: Lowell Dijkstra (b.1952) + gluck.debian.org: Christoph Willibald Ritter von Gluck (2 July 1714 - 15 November 1787) + goedel.debian.org: Kurt Gödel (April 28, 1906 - January 14, 1978) + goetz.debian.org: Hermann Gustav Goetz (December 7, 1840 - December 3, 1876) + handel.debian.org: Georg Friedrich Händel (23 February 1685 – 14 April 1759) + kassia.debian.org: Kassia (between 805 and 810 - bef. 867) + klecker.debian.org: Dedicated to Joel 'Espy' Klecker (1979 - July 11, 2000) + lafayette.debian.org: Eugenie Lafayette + lebrun.debian.org: Francesca Lebrun (March 24, 1756 - May 14, 1791) + mahler.debian.org: Gustav Mahler (7 July 1860 – 18 May 1911) + mayr.debian.org: Johann(es) Simon Mayr (June 14, 1763 - December 2, 1845) + merkel.debian.org: Gustav (Adolf) Merkel (November 12, 1827 - October 30, 1885) + merulo.debian.org: Claudio Merulo (8 April 1533 - 4 May 1604) + morales.debian.org: Cristóbal de Morales (c. 1500 - between September 4 and October 7, 1553) + mundy.debian.org: William Mundy (c. 1529 – 1591) + paer.debian.org: Ferdinando Paër (July 1, 1771 - May 3, 1839) + penalosa.debian.org: Francisco de Peñalosa (c. 1470 – April 1, 1528) + pergolesi.debian.org: Giovanni Battista Pergolesi (4 January 1710 - 16 or 17 March 1736) + ravel.debian.org: Joseph-Maurice Ravel (March 7, 1875 – December 28, 1937) + schroeder.debian.org: Hermann Schroeder (1904-1984), German composer and conductor +footer: + bartok.debian.org: "Documentation: gluck:/org/admin.debian.org/doc/backup.debian.org" +--- + diff --git a/modules/debian-org/templates/nodeinfo.erb b/modules/debian-org/templates/nodeinfo.erb new file mode 100644 index 00000000..0ad19603 --- /dev/null +++ b/modules/debian-org/templates/nodeinfo.erb @@ -0,0 +1,32 @@ +<% +require 'ldap' +require 'yaml' + +$KCODE = 'utf-8' + +yaml = YAML.load_file("/etc/puppet/modules/debian-org/misc/nodeinfo.yaml") + +results = {} +['nameinfo', 'footer'].each do |detail| + if yaml.has_key?(detail) + if yaml[detail].has_key?($name) + results[detail] = yaml[detail][$name] + end + end +end + +ldap = LDAP::Conn.new('samosa.debian.org') + +results['ldap'] = [] +filter = '(hostname=' + $name +')' +begin + ldap.search2('ou=hosts,dc=debian,dc=org', LDAP::LDAP_SCOPE_SUBTREE, filter) do |x| + results['ldap'] << x + end +rescue LDAP::ResultError +rescue RuntimeError +ensure + ldap.unbind +end +results +-%> -- 2.39.2