From ef688068c066386bf366c1d7c14a820adf5bf307 Mon Sep 17 00:00:00 2001
From: Fredrik Thulin <fredrik@thulin.net>
Date: Tue, 27 May 2014 10:39:29 +0200
Subject: Figure out best interface to use for DHCP.

---
 global/overlay/etc/puppet/manifests/cosmos-site.pp | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

(limited to 'global/overlay/etc/puppet')

diff --git a/global/overlay/etc/puppet/manifests/cosmos-site.pp b/global/overlay/etc/puppet/manifests/cosmos-site.pp
index e8d2615..8e23e76 100644
--- a/global/overlay/etc/puppet/manifests/cosmos-site.pp
+++ b/global/overlay/etc/puppet/manifests/cosmos-site.pp
@@ -491,11 +491,17 @@ node 'cdr1.sunet.se' {
 
 class sunet-cdr {
 
+  # Listen on br0 if it exists (cdr1), otherwise bond0 (cdr2).
+  $interface = $::ipaddress_br0 ? {
+    undef   => 'bond0',
+    default => 'br0',
+  }
+
   class { 'dhcp':
       dnsdomain    => [ 'eduid.se','sunet.se','swamid.se' ],
       nameservers  => ['130.242.80.14','130.242.80.99'],
       ntpservers   => ['ntp1.nordu.net','ntp2.nordu.net','Time1.Stupi.SE'],
-      interfaces   => ['bond0'],
+      interfaces   => [$interface],
       #pxeserver    => '130.242.125.5',
       #pxefilename  => 'pxelinux.0'
    }
-- 
cgit v1.1