Elektrine lite

← Feed

@laird@hachyderm.io

2026-07-25 18:09 UTC

Today's morning fun: playing with creating a Netbox config template for my Arista devices. - Good: it's actually pretty simple to get started. Almost no new infrastructure needed, unlike the time I tried to do this in Ansible and felt like I was pushing a rock uphill the whole time. - Good: the data model (shockingly) matches reasonably well. - Bad: oh god, not jinja2 again. - Meh: you're mostly just left with a blob of text; there's no actual automation for diffing/deploying/etc. Although plugins are available - Bad: the mismatch between jinja2 templates and Actual Python(tm) gets *really* annoying. It's like *half* python and half not. It's just fine for simple stuff -- "iterate over all interfaces and add `mtu {{ interface.mtu}}`" is easy. Iterating over all IPs for each interface and adding `ip address` or `ipv6 address`, depending, isn't too bad. Iterating over all IPs for each interface *plus* FHRP (VRRP, etc) addresses for each interface, plus dealing with corner cases is a making me lose hair. - Meh: there are missing things in Netbox's data model that would be really nice, like the MLAG ID. There are plugins for some of this, and people have built giant complicated models for other bits; I'm tempted to just add a custom field for the ~dozen cases where I care. - Meh: avoiding excessive newlines around `{% if ... %} command{% endif %}` in jinja2 is really annoying me. I guess I should probably re-read the manual -- I want "output what I say, without trying to reformat anything, but don't emit totally blank lines". Lots of blank lines: easy. No newlines at all: easy. Newlines in the right place: not so much.

Replies (0)

No replies.