Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grammar #3

Closed
kaniini opened this issue Jul 24, 2020 · 3 comments
Closed

grammar #3

kaniini opened this issue Jul 24, 2020 · 3 comments

Comments

@kaniini
Copy link
Collaborator

kaniini commented Jul 24, 2020

I want to normalize the grammar to be fully triple-based instead of mostly triple-based. We will support the legacy ifupdown config syntax, but print deprecation warnings.

New format looks vaguely like:

auto eth0
iface eth0
   # use triplet defines if we should use something, like dhcp
   use dhcp

   # inheritance (issue #2)
   inherits foo

   # requires (ensure bar comes up before eth0, as eth0 needs bar)
   requires bar

   # addresses are CIDR, netmask is used as fallback for addresses that
   # don't define a CIDR length
   address 1.2.3.4/5
   address 2602::1/32

   # gateway works as expected
   gateway 1.2.3.255
   gateway 2602::0

   # all of this is the same
   pre-up ...
   up ...
   post-up ...
   pre-down ...
   down ...
   post-down ...

A real world config (with alpine bonding and bridge scripts installed, presumably similar for Debian):

iface bond0
   use bond

   # for compatibility, we translate requires into bond-slaves
   # eth0 and eth1 interfaces requiring no specific configuration will
   # have their configuration nodes generated on the fly
   requires eth0 eth1
   bond-mode 802.3ad
   bond-xmit-hash-policy layer2+3

auto br0
iface br0
   use bridge

   # for compatibility, we translate requires into bridge-ports
   requires bond0
   address 172.93.5.34/28
   address 10.150.241.1/24
   gateway 172.93.5.33
@kaniini
Copy link
Collaborator Author

kaniini commented Jul 24, 2020

@andrewshadura thoughts ^

@kaniini
Copy link
Collaborator Author

kaniini commented Jul 24, 2020

some people in IRC asked, why triple-based?

simply put, it is easy to represent a collection of triples as a tree if you use the left side as the parent leaf. this means representing the config as JSON-LD (backed by a YANG model in @context) is easy. that allows for very simple restconf integration for management.

@kaniini
Copy link
Collaborator Author

kaniini commented Jul 25, 2020

ok i think this is basically implemented at this point :)

@kaniini kaniini closed this as completed Jul 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant