coren has uploaded a new change for review.

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

Change subject: Labs: manage resolv.conf in labs also
......................................................................

Labs: manage resolv.conf in labs also

Labs currently uses the install-default resolv.conf rather
than manage it with puppet.  This corrects that, and adds
a template for it with suitable values for labs.

There are two FIXMEs this will need: put the template
outside of modules/base (requires making a module for labs)
and find a clean way to bubble down the nameserver IP rather
than hardcode it (it's currently hardcoded in a half-dozen
places).

Bug: T63897
Change-Id: I290c32fdeedc9319b804f886c21fe1c49a6c864f
---
M modules/base/manifests/resolving.pp
A modules/base/templates/resolv.conf.labs.erb
2 files changed, 16 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/58/194858/1

diff --git a/modules/base/manifests/resolving.pp 
b/modules/base/manifests/resolving.pp
index 435362a..5592950 100644
--- a/modules/base/manifests/resolving.pp
+++ b/modules/base/manifests/resolving.pp
@@ -5,12 +5,13 @@
         error("Variable ${::nameservers} is not defined!")
     }
     else {
-        if $::realm != 'labs' {
-            file { '/etc/resolv.conf':
-                owner   => 'root',
-                group   => 'root',
-                mode    => '0444',
-                content => template('base/resolv.conf.erb'),
+        file { '/etc/resolv.conf':
+            owner   => 'root',
+            group   => 'root',
+            mode    => '0444',
+            content => $::realm? {
+                'labs'  => template('base/resolv.conf.labs.erb'),
+                default => template('base/resolv.conf.erb'),
             }
         }
     }
diff --git a/modules/base/templates/resolv.conf.labs.erb 
b/modules/base/templates/resolv.conf.labs.erb
new file mode 100644
index 0000000..5c894ae
--- /dev/null
+++ b/modules/base/templates/resolv.conf.labs.erb
@@ -0,0 +1,9 @@
+## THIS FILE IS MANAGED BY PUPPET
+##
+## source: modules/base/resolv.conf.labs.erb
+## from:   base::resolving
+
+domain <%= site %>.wmflabs
+search <%= site %>.wmflabs svc.<%= site %>.wmnet
+options timeout:5 ndots:2
+nameserver 10.68.16.1

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I290c32fdeedc9319b804f886c21fe1c49a6c864f
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: coren <mpellet...@wikimedia.org>

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

Reply via email to