example42/puppet-network

mroute RedHat with multiple nexthops and specific table has wrong order

Opened this issue · 0 comments

Expected Behavior

It should be possible to add mroutes with multiple gateways to a specific table

Actual Behavior

When setting a mroute with muliple nexthops (eg ECMP) and an explicit defined table, the resulting command in the route file has the wrong order and is therefore not applied on network (re-)start
The table parameter is added after the vias which works with a single gateway but not with multiple nexthops.

<%- if @table %> table <%= @table %><% end %>

This happens also if only one gateway is specified as an array, see

if gw.kind_of?(Array)

Steps to Reproduce the Problem

  network::mroute { 'eth0':
    routes => {
      '1.1.1.1/32' => [ '192.168.1.1', '192.168.2.1', ],
    }
    table => 'fallback'
  }

Suggested fix

Move the table to the beginning of the line, before all gateways. Tested manually, works.

Specifications

tested with 3.5.3 but shouln'd have changed since