Skip to content

Commit

Permalink
templates
Browse files Browse the repository at this point in the history
  • Loading branch information
kellerza committed Jun 8, 2021
1 parent 6106301 commit a63c976
Show file tree
Hide file tree
Showing 11 changed files with 80 additions and 226 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ require (
github.com/google/uuid v1.2.0
github.com/hashicorp/go-version v1.2.1
github.com/jsimonetti/rtnetlink v0.0.0-20210226120601-1b79e63a70a0
github.com/kellerza/template v0.0.1
github.com/kellerza/template v0.0.3
github.com/mitchellh/go-homedir v1.1.0
github.com/morikuni/aec v1.0.0 // indirect
github.com/olekukonko/tablewriter v0.0.5-0.20201029120751-42e21c7531a3
Expand Down
7 changes: 4 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -413,8 +413,8 @@ github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/kellerza/template v0.0.1 h1:4myoezGQD/BDIu+IOEGej60mcjz7LTjaJ2M6H7REIcg=
github.com/kellerza/template v0.0.1/go.mod h1:DRgSShodacWyLf9h+LWtlxxvTfWZW/AQlHKX2kb8g+4=
github.com/kellerza/template v0.0.3 h1:JWRnuMZnTHO1onmSj3HYQA/CJqn4x+CiKFD+bbD0SNE=
github.com/kellerza/template v0.0.3/go.mod h1:Og3Jdssypk1J/bNpWIrmymW5FOWI88vsY5Qx/e57V7M=
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
Expand Down Expand Up @@ -851,8 +851,9 @@ golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20210123111255-9b0068b26619/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210216163648-f7da38b97c65/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210324051608-47abb6519492 h1:Paq34FxTluEPvVyayQqMPgHm+vTOrIifmcYxFBx9TLg=
golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210510120138-977fb7262007 h1:gG67DSER+11cZvqIMb8S8bt0vZtiN6xWYARwirrOSfE=
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210503060354-a79de5458b56 h1:b8jxX3zqjpqb2LklXPzKSGJhzyxCOZSz8ncv8Nv+y7w=
golang.org/x/term v0.0.0-20210503060354-a79de5458b56/go.mod h1:tfny5GFUkzUvx4ps4ajbZsCe5lw1metzhBm9T3x7oIY=
Expand Down
75 changes: 75 additions & 0 deletions templates/config/base-srl.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{{ expect .systemip "ip" }}
{{ optional .isis_iid "0-31" }}
{{ range .links }}
{{ expect .port "^(ethernet-\\d+/|e\\d+-)\\d+$" }}
{{ expect .name "string" }}
{{ expect .ip "ip" }}
{{ optional .vlan "0-4095" }}
{{ optional .metric "1-10000" }}
{{ end }}

/interface lo0 {
admin-state enable
subinterface 0 {
ipv4 {
address {{ .systemip }} {
}
}
ipv6 {
address ::ffff:{{ ip .systemip }}/128 {
}
}
}
}

/network-instance default {
router-id {{ ip .systemip }}
interface lo0.0 {
}
protocols {
isis {
instance default {
admin-state enable
level-capability L2
set level 2 metric-style wide
# net should not be multiline (net [), becasue of the SRL ... prompt
net [ 49.0000.0000.0000.0{{ default 0 .isis_iid }} ]
interface lo0.0 {
}
}
}
}
}

/system lldp admin-state enable


{{ .range links }}
/interface {{ .port }} {
admin-state enable
vlan-tagging true
subinterface {{ default 10 .vlan }} {
set vlan encap single-tagged vlan-id {{ default 10 .vlan }}
set ipv4 address {{ .ip }}
set ipv6 address ::FFFF:{{ ip .ip }}/127
}
}

/network-instance default {
interface {{ .port }}.{{ default 10 .vlan }} {
}
protocols {
isis {
instance default {
interface {{ .port }}.{{ default 10 .vlan }} {
circuit-type point-to-point
level 2 {
metric {{ default 10 .metric }}
}
}
}
}
}
}

{{ end }}
File renamed without changes.
33 changes: 0 additions & 33 deletions templates/srl/base-link.tmpl

This file was deleted.

37 changes: 0 additions & 37 deletions templates/srl/base-node.tmpl

This file was deleted.

Empty file.
47 changes: 0 additions & 47 deletions templates/vr-sros/base-link.tmpl

This file was deleted.

105 changes: 0 additions & 105 deletions templates/vr-sros/base-node.tmpl

This file was deleted.

Empty file.

0 comments on commit a63c976

Please sign in to comment.