[Start] Writing system automation scripts and services

Preamble: Opening the gate wider for more crafters/tinkerers:

I love this community and constantly keep learning new things (and sometimes getting less done because of it :joy:).

I don’t have a lot to contribute to some of the more advanced discussions and quickly a lot discussions on the forum are already becoming fairly involved. I’m a staunch believer in bringing more people into my interests and hobbies and helping noobs just like I was helped (and still being helped).

Since discussions and topics are already intimidating (enough that I feel like I needed to write this preamble), I want to be add more beginner friendly topics to the mix. I hope to continue writing more articles on my website in a similar vein as well as finding cool things that make crafting more accessible. I would love feedback on this whole approach, including if this isn’t the best place to share this information.

Writing system automation scripts and services

I would also love your feedback on this article, especially around how to explain things better for the intended audience. Sub-text: please keep in mind that it’s meant to be accessible to people starting out. I know Emacs can do everything but not everyone can dive into the deep end but they can still system craft, we’ll get 'em eventually.

:nerd_face: cred: Website is built using Org-mode and ox-Hugo and deployed via magit to SourceHut.

Edit: maybe starter friendly topics could have a tag so it can be filtered out if desired?


Excellent article, thanks a lot for sharing it! I would love for more folks to do this, write helpful articles or make videos and post them here on the forum. Thanks for kicking it off!

1 Like

I feel like making videos is little nerve-wracking and editing sucks, you make it look so easy though. But recording videos is on the personal growth agenda so +if+ when I make videos I’ll nervously post a link here :grimacing:

Thanks for the encouragement!

1 Like

Well, that is kinda true :slight_smile:


Interesting post.

I’ve been thinking a lot lately about how message busii and pub/sub workflows are not used nearly enough for automation purposes.

Have some really hacky elisp to allow me to control things with my Regolith3/GNOME desktop using consult and transient directly from Emacs.

I made a post in Programming earlier this weekend about an idea around using Lua/fennel for various infrastructure automation and I’ve been thinking about x-node dependencies as a function of pub/sub flow.

Not necessarily where you were going with your post but just to let you know it prompted some other ideas.

1 Like

Thanks for sharing! I read your post now. Having a framework to hook into automation in a simple pub/sub model would be very nice. Almost a IFFT for the local machine. I’d like to learn more about guix, even though Nix is the new hotness. I understand your concern about low-end devices but do those need to run the scripts or can they run a compiled binary, so your infra weight becomes less of an issue? I’m all about exposing the code so changes can be made locally (which is why I skew heavy to shell scripting), but on more appliance level devices you’re not really developing on the device itself. Just curious what your thoughts are on that.

So in the past the way this has worked is that a runtime is created (via Chef/Puppet agent) and the framework provides some form of DSL. That agent is responsible for fetching the code or in the case of Puppet a compiled manifest called the catalog. The size and portability of that runtime is often a limiting factor as to where the agent can run. Both Puppet and Chef are Ruby-based – basically full-stop for most net devices – and Ansible is Python based – Python being a bit more attractive to NetOps because they already do a lot of work with the language.

Neither Python nor Ruby is really appropriate when you get down to the really small IoT devices. Like stuff smaller than a Pi. I posit Lua and fennel would probably be just fine in those constrained environments and Lua/fennel would be a relatively easy sell at the NetOps layer due to it being quite friendly to C/C++ devs.

If I pursue this I think I would go the Puppet model and have an embedded Lua/fennel-based agent and have it pass a catalog around (from memory, a json-based DAG scoped to the node). This allows for some control against malicious code and probably be less resource heavy to check and enforce on those smaller devices.

Another thing I would want to do is have the catalog be scoped not just to a node but to a particular user on that node. That would then allow the framework do some applies without admin privs and it would allow end-users to configure their specific account (guix package? OBS settings?) using the same tooling as what is being used to configure the rest of the infrastructure.

Anyway, I’m jacking your thread. And its time to stop talking and start designing + implementing.

1 Like

hahaha no you’re not hijacking this thread at all, this is all good chatting.

I definitely see what you mean about embedded devices, my background is electrical/software engineering for embedded devices. That’s generally where we would just deploy a “golden image” type approach. But a low overhead configuration system would be interesting for device level configuration, generally we’d push that down with a command interface or reading harness location for totally embedded devices without connectivity.

So yeah, long way to say that would be some really interesting applications for something that can perform configuration across the entire stack. Looking forward to what you cook up!