Skip to content

Refactor profile::network to be more extensible

  • Make explicit routes on the private network configurable properly
  • Switch the networks dict to be keyed by the interface name
  • Enable other methods (than statics) of setting up the network interfaces
  • network: Add support for mtu value
  • network: Add support for extra settings

Test Plan

octocatalog-diff run on a few hosts that have a network configuration shows only a change to the azure subnet (which is a /21 not a /24).

$ bin/octocatalog-diff -t current pergamon worker01        
Found host pergamon.softwareheritage.org
Found host worker01.softwareheritage.org
*** Running octocatalog-diff on host pergamon.softwareheritage.org
I, [2020-09-15T11:16:39.148902 #19998]  INFO -- : Catalogs compiled for pergamon.softwareheritage.org
I, [2020-09-15T11:16:40.182046 #19998]  INFO -- : Diffs computed for pergamon.softwareheritage.org
diff origin/production/pergamon.softwareheritage.org current/pergamon.softwareheritage.org
*******************************************
  Concat::Fragment[eth1_stanza] =>
   parameters =>
     content =>
      @@ -15,5 +15,5 @@
         down ip rule del from 192.168.100.29 table private
         down ip route del 192.168.128.0/24 via 192.168.100.125
      -  down ip route del 192.168.200.0/24 via 192.168.100.1
      +  down ip route del 192.168.200.0/21 via 192.168.100.1
         down ip route del 192.168.101.0/24 via 192.168.100.1
         down ip route flush cache
*******************************************
  Concat_fragment[eth1_stanza] =>
   parameters =>
     content =>
      @@ -15,5 +15,5 @@
         down ip rule del from 192.168.100.29 table private
         down ip route del 192.168.128.0/24 via 192.168.100.125
      -  down ip route del 192.168.200.0/24 via 192.168.100.1
      +  down ip route del 192.168.200.0/21 via 192.168.100.1
         down ip route del 192.168.101.0/24 via 192.168.100.1
         down ip route flush cache
*******************************************
  Debnet::Iface[eth1] =>
   parameters =>
     downs =>
      - ["ip route del default via 192.168.100.1 dev eth1 table private", "ip route del 192.168.100.0/24 src 192.168.100.29 dev eth1 table private", "ip rule del from 192.168.100.29 table private", "ip route del 192.168.128.0/24 via 192.168.100.125", "ip route del 192.168.200.0/24 via 192.168.100.1", "ip route del 192.168.101.0/24 via 192.168.100.1", "ip route flush cache"]
      + ["ip route del default via 192.168.100.1 dev eth1 table private", "ip route del 192.168.100.0/24 src 192.168.100.29 dev eth1 table private", "ip rule del from 192.168.100.29 table private", "ip route del 192.168.128.0/24 via 192.168.100.125", "ip route del 192.168.200.0/21 via 192.168.100.1", "ip route del 192.168.101.0/24 via 192.168.100.1", "ip route flush cache"]
*******************************************
*** End octocatalog-diff on pergamon.softwareheritage.org
*** Running octocatalog-diff on host worker01.softwareheritage.org
I, [2020-09-15T11:16:44.248318 #20055]  INFO -- : Catalogs compiled for worker01.softwareheritage.org
I, [2020-09-15T11:16:44.489755 #20055]  INFO -- : Diffs computed for worker01.softwareheritage.org
diff origin/production/worker01.softwareheritage.org current/worker01.softwareheritage.org
*******************************************
  Concat::Fragment[ens19_stanza] =>
   parameters =>
     content =>
      @@ -13,5 +13,5 @@
         down ip route del 192.168.100.0/24 src 192.168.100.21 dev ens19 table private
         down ip rule del from 192.168.100.21 table private
      -  down ip route del 192.168.200.0/24 via 192.168.100.1
      +  down ip route del 192.168.200.0/21 via 192.168.100.1
         down ip route del 192.168.101.0/24 via 192.168.100.1
         down ip route flush cache
*******************************************
  Concat_fragment[ens19_stanza] =>
   parameters =>
     content =>
      @@ -13,5 +13,5 @@
         down ip route del 192.168.100.0/24 src 192.168.100.21 dev ens19 table private
         down ip rule del from 192.168.100.21 table private
      -  down ip route del 192.168.200.0/24 via 192.168.100.1
      +  down ip route del 192.168.200.0/21 via 192.168.100.1
         down ip route del 192.168.101.0/24 via 192.168.100.1
         down ip route flush cache
*******************************************
  Debnet::Iface[ens19] =>
   parameters =>
     downs =>
      - ["ip route del default via 192.168.100.1 dev ens19 table private", "ip route del 192.168.100.0/24 src 192.168.100.21 dev ens19 table private", "ip rule del from 192.168.100.21 table private", "ip route del 192.168.200.0/24 via 192.168.100.1", "ip route del 192.168.101.0/24 via 192.168.100.1", "ip route flush cache"]
      + ["ip route del default via 192.168.100.1 dev ens19 table private", "ip route del 192.168.100.0/24 src 192.168.100.21 dev ens19 table private", "ip rule del from 192.168.100.21 table private", "ip route del 192.168.200.0/21 via 192.168.100.1", "ip route del 192.168.101.0/24 via 192.168.100.1", "ip route flush cache"]
*******************************************
*** End octocatalog-diff on worker01.softwareheritage.org

Migrated from D3946 (view on Phabricator)

Merge request reports

Loading