Enable lingering for the contributors user
[mirror/dsa-puppet.git] / modules / roles / manifests / bgp.pp
index 61409d9..ee41df5 100644 (file)
@@ -1,22 +1,13 @@
-class roles::bgp {
-       $bgp_peers = $::hostname ? {
-               bilbao        => '2001:41c9:2:13c::2/128 89.16.162.2/32',
-               mirror-conova => '2a02:16a8:5404:199::25/128 217.196.157.53/32',
-               default       => undef,
-       }
-
-       if ! $bgp_peers {
-               fail("Do not have bgp_peers set for $::hostname.")
-       }
-
-       @ferm::rule { 'dsa-bgp':
-               description => 'Allow BGP from peers',
-               domain      => '(ip ip6)',
-               rule        => "&SERVICE_RANGE(tcp, bgp, ($bgp_peers))"
-       }
-
-       file { '/etc/network/interfaces.d/anycasted':
-               content => template('roles/anycast/interfaces.erb')
-       }
-
+class roles::bgp(
+  Array[Stdlib::IP::Address] $peers,
+){
+  ferm::rule::simple { 'dsa-bgp':
+    description => 'Allow BGP from peers',
+    port        => 'bgp',
+    saddr       => $peers,
+  }
+
+  file { '/etc/network/interfaces.d/anycasted':
+    content => template('roles/anycast/interfaces.erb')
+  }
 }