Andrew Bogott has uploaded a new change for review.

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

Change subject: Moved the dns::recursor class into a module
......................................................................

Moved the dns::recursor class into a module

Change-Id: I0e20676d2e4b54022610363483681b7b8efa14f2
---
M manifests/dns.pp
M manifests/role/dns.pp
M manifests/site.pp
A modules/dnsrecursor/manifests/init.pp
R modules/dnsrecursor/templates/recursor.conf.erb
5 files changed, 81 insertions(+), 82 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/21/196621/1

diff --git a/manifests/dns.pp b/manifests/dns.pp
index 3c061e7..7509b69 100644
--- a/manifests/dns.pp
+++ b/manifests/dns.pp
@@ -53,76 +53,3 @@
     }
 
 }
-
-# Class: Dns::Recursor
-# Parameters:
-# - $listen_addresses:
-#       Addresses the DNS recursor should listen on for queries
-#       (default: [$::ipaddress])
-# - $allow_from:
-#       Prefixes from which to allow recursive DNS queries
-class dns::recursor(
-    $listen_addresses = [$::ipaddress],
-    $allow_from       = []
-) {
-    package { 'pdns-recursor':
-        ensure => 'latest',
-    }
-
-    system::role { 'dns::recursor':
-        ensure      => 'absent',
-        description => 'Recursive DNS server',
-    }
-
-    include network::constants
-
-    file { '/etc/powerdns/recursor.conf':
-        ensure  => 'present',
-        require => Package['pdns-recursor'],
-        owner   => 'root',
-        group   => 'root',
-        mode    => '0444',
-        content => template('powerdns/recursor.conf.erb'),
-    }
-
-    service { 'pdns-recursor':
-        ensure    => 'running',
-        require   => [Package['pdns-recursor'],
-                      File['/etc/powerdns/recursor.conf']
-        ],
-        subscribe => File['/etc/powerdns/recursor.conf'],
-        pattern   => 'pdns_recursor',
-        hasstatus => false,
-    }
-
-    class metrics {
-        # install ganglia metrics reporting on pdns_recursor
-        file { '/usr/local/sbin/pdns_gmetric':
-            ensure => 'present',
-            owner  => 'root',
-            group  => 'root',
-            mode   => '0555',
-            source => 'puppet:///files/powerdns/pdns_gmetric',
-        }
-        cron { 'pdns_gmetric_cron':
-            require => File['/usr/local/sbin/pdns_gmetric'],
-            command => '/usr/local/sbin/pdns_gmetric',
-            user    => 'root',
-            minute  => '*',
-        }
-    }
-
-    define monitor() {
-        # Monitoring
-        monitoring::host { $title:
-            ip_address => $title,
-        }
-        monitoring::service { "recursive dns ${title}":
-            host          => $title,
-            description   => 'Recursive DNS',
-            check_command => 'check_dns!www.wikipedia.org',
-        }
-    }
-
-    include metrics
-}
diff --git a/manifests/role/dns.pp b/manifests/role/dns.pp
index b029872..b7b93a7 100644
--- a/manifests/role/dns.pp
+++ b/manifests/role/dns.pp
@@ -65,15 +65,15 @@
     }
 }
 
-class role::dns::recursor {
-    system::role { 'role::dns::recursor': description => 'Recursive DNS 
server' }
+class role::dnsrecursor {
+    system::role { 'role::dnsrecursor': description => 'Recursive DNS server' }
 
     include lvs::configuration, network::constants
 
     class {
         'lvs::realserver':
             realserver_ips => 
$lvs::configuration::lvs_service_ips[$::realm]['dns_rec'][$::site];
-        '::dns::recursor':
+        '::dnsrecursor':
             require             => Class['lvs::realserver'],
             listen_addresses    => [$::ipaddress,
                                     $::ipaddress6_eth0,
@@ -82,7 +82,7 @@
             allow_from          => $network::constants::all_networks;
     }
 
-    ::dns::recursor::monitor { [ $::ipaddress, $::ipaddress6_eth0 ]: }
+    ::dnsrecursor::monitor { [ $::ipaddress, $::ipaddress6_eth0 ]: }
 
     ferm::service { 'udp_dns_rec':
         proto => 'udp',
diff --git a/manifests/site.pp b/manifests/site.pp
index 62f0d10..5eb4da1 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -49,7 +49,7 @@
     include base::firewall
     include standard
 
-    include role::dns::recursor
+    include role::dnsrecursor
 
     interface::add_ip6_mapped { 'main':
         interface => 'eth0',
@@ -415,7 +415,7 @@
     include admin
     include base::firewall
     include standard
-    include role::dns::recursor
+    include role::dnsrecursor
 
     if $::hostname == 'chromium' {
         $url_downloader_ip = hiera('url_downloader_ip')
@@ -2026,7 +2026,7 @@
 }
 
 node 'nescio.esams.wikimedia.org' {
-    interface::ip { 'dns::recursor':
+    interface::ip { 'dnsrecursor':
         interface => 'eth0',
         address   => '91.198.174.6',
     }
@@ -2036,12 +2036,12 @@
 
     include network::constants
 
-    class { 'dns::recursor':
+    class { 'dnsrecursor':
         listen_addresses => ['91.198.174.6'],
         allow_from       => $network::constants::all_networks,
     }
 
-    dns::recursor::monitor { '91.198.174.6': }
+    dnsrecursor::monitor { '91.198.174.6': }
 }
 
 node 'netmon1001.wikimedia.org' {
diff --git a/modules/dnsrecursor/manifests/init.pp 
b/modules/dnsrecursor/manifests/init.pp
new file mode 100644
index 0000000..e504936
--- /dev/null
+++ b/modules/dnsrecursor/manifests/init.pp
@@ -0,0 +1,72 @@
+# Class: dnsrecursor
+# Parameters:
+# - $listen_addresses:
+#       Addresses the DNS recursor should listen on for queries
+#       (default: [$::ipaddress])
+# - $allow_from:
+#       Prefixes from which to allow recursive DNS queries
+class dnsrecursor(
+    $listen_addresses = [$::ipaddress],
+    $allow_from       = []
+) {
+    package { 'pdns-recursor':
+        ensure => 'latest',
+    }
+
+    system::role { 'dnsrecursor':
+        ensure      => 'absent',
+        description => 'Recursive DNS server',
+    }
+
+    include network::constants
+
+    file { '/etc/powerdns/recursor.conf':
+        ensure  => 'present',
+        require => Package['pdns-recursor'],
+        owner   => 'root',
+        group   => 'root',
+        mode    => '0444',
+        content => template('powerdns/recursor.conf.erb'),
+    }
+
+    service { 'pdns-recursor':
+        ensure    => 'running',
+        require   => [Package['pdns-recursor'],
+                      File['/etc/powerdns/recursor.conf']
+        ],
+        subscribe => File['/etc/powerdns/recursor.conf'],
+        pattern   => 'pdns_recursor',
+        hasstatus => false,
+    }
+
+    class metrics {
+        # install ganglia metrics reporting on pdns_recursor
+        file { '/usr/local/sbin/pdns_gmetric':
+            ensure => 'present',
+            owner  => 'root',
+            group  => 'root',
+            mode   => '0555',
+            source => 'puppet:///files/powerdns/pdns_gmetric',
+        }
+        cron { 'pdns_gmetric_cron':
+            require => File['/usr/local/sbin/pdns_gmetric'],
+            command => '/usr/local/sbin/pdns_gmetric',
+            user    => 'root',
+            minute  => '*',
+        }
+    }
+
+    define monitor() {
+        # Monitoring
+        monitoring::host { $title:
+            ip_address => $title,
+        }
+        monitoring::service { "recursive dns ${title}":
+            host          => $title,
+            description   => 'Recursive DNS',
+            check_command => 'check_dns!www.wikipedia.org',
+        }
+    }
+
+    include metrics
+}
diff --git a/templates/powerdns/recursor.conf.erb 
b/modules/dnsrecursor/templates/recursor.conf.erb
similarity index 100%
rename from templates/powerdns/recursor.conf.erb
rename to modules/dnsrecursor/templates/recursor.conf.erb

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0e20676d2e4b54022610363483681b7b8efa14f2
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Andrew Bogott <abog...@wikimedia.org>

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

Reply via email to