ossobv / vcutil

Misc. simple utilities to aid version control and host maintenance.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

interfaces2netplan: cmd 'bond-mode' unknown/unimplemented

vilitux opened this issue · comments

We have the following configuration active in /etc/network/interfaces:

auto bond0
iface bond0 inet static
  address 192.168.1.25
  netmask 255.255.255.0
  gateway 192.168.1.1
  dns-nameservers 8.8.8.8 8.8.4.4
  bond-mode active-backup
  bond-miimon 100
  bond-slaves eno1 eno2

When using interfaces2netplan, it gives us the following stacktrace:

Traceback (most recent call last):
  File "/usr/bin/interfaces2netplan", line 399, in <module>
    main()
  File "/usr/bin/interfaces2netplan", line 394, in main
    files.show()
  File "/usr/bin/interfaces2netplan", line 183, in show
    yaml = self.get_yaml()
  File "/usr/bin/interfaces2netplan", line 162, in get_yaml
    ifile = InterfacesParser(interfaces_lines)
  File "/usr/bin/interfaces2netplan", line 203, in __init__
    self._parse()
  File "/usr/bin/interfaces2netplan", line 255, in _parse
    str(i) for i in e.args)))
ValueError: /etc/network/interfaces:24: parse fail at ' bond-mode active-backup': cmd 'bond-mode' unknown/unimplemented

The expected output would've been something like this:

network:
  version: 2
  renderer: networkd
  bonds:
    bond0:
      interfaces:
        - eno1
        - eno2
      addresses: 
        - 192.168.1.25/24
      gateway4: 192.168.1.1
      nameservers:
        addresses: 
          - 8.8.8.8
          - 8.8.4.4
      parameters:
        mode: active-backup
        mii-monitor-interval: 100

or

network:
  version: 2
  renderer: networkd
  bonds:
    bond0:
      interfaces: [eno1, eno2]
      addresses: [192.168.1.25/24]
      gateway4: 192.168.1.1
      nameservers:
        addresses: [8.8.8.8, 8.8.4.4]
      parameters:
        mode: active-backup
        mii-monitor-interval: 100

Old ticket. Hardly any users for this anymore. Closing.