You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After trying to come up with a playbook solution to ensure only the wifi-ifaces I've created exist, I've found that ansible-openwrt's remote-only use of UCI is pretty restrictive. It would be easier to deal with configuration state if we could manage some of it locally using e.g. set_fact, but since uci output is hard to parse, that goes out of the window without some rather nasty Python.
We could fix this with Lua's UCI bindings, but even cleaner than that would be ucode, which has bindings for UCI (among other things) already in-place.
The only drawback I can see for now is availability -- as it stands ucode is only pre-installed on 22.03, and isn't yet being compiled or distributed for 21.02, 19.07, etc.
An example snippet of ucode dumping /etc/config/wireless to JSON would be:
I can use snippets of ucode to feed playbooks for now, but you may want to consider refactoring using ucode to make maintenance easier, at least once it's officially available.
Thanks for your time :^)
The text was updated successfully, but these errors were encountered:
Hi there,
After trying to come up with a playbook solution to ensure only the
wifi-iface
s I've created exist, I've found that ansible-openwrt's remote-only use of UCI is pretty restrictive. It would be easier to deal with configuration state if we could manage some of it locally using e.g.set_fact
, but sinceuci
output is hard to parse, that goes out of the window without some rather nasty Python.We could fix this with Lua's UCI bindings, but even cleaner than that would be
ucode
, which has bindings for UCI (among other things) already in-place.The only drawback I can see for now is availability -- as it stands
ucode
is only pre-installed on 22.03, and isn't yet being compiled or distributed for 21.02, 19.07, etc.An example snippet of
ucode
dumping/etc/config/wireless
to JSON would be:This can be run e.g. as
I can use snippets of
ucode
to feed playbooks for now, but you may want to consider refactoring usingucode
to make maintenance easier, at least once it's officially available.Thanks for your time :^)
The text was updated successfully, but these errors were encountered: