Hacker News new | ask | show | jobs
by mattbillenstein 469 days ago
Yeah, just prefer writing little cli tools in Python or something once the shell script gets too complex...

Sorta hate yaml drive config management and deployments sytems aka ansible, saltstack, etc; so ended up writing my own that's salt-like, but all python.

3 comments

or a middle path solution like https://github.com/pyinfra-dev/pyinfra
A couple years ago I did some experimenting with applying Ansible ideas on a smaller scale (like a shell script rather than operating on fleets of machines). I started off with using YAML and some alternate syntaxes, because I was coming from ansible.

But then I decided I really kind of despise "programming" in YAML (conditionals and loops in particular). So I adapted Ansible ideas to Python, in particular: idempotent commands and notifications (commands triggered later, when another set of commands make a change; like restarting apache after making a bunch of config changes).

https://github.com/linsomniac/uplaybook?tab=readme-ov-file

Interesting, I built a whole rpc / file-server ala saltstack on top of something like this:

https://github.com/mattbillenstein/salty

Been using this on a couple startups for a couple years, but it lacks polish in terms of user-friendliness.

Interesting how we came to some of the same types of things - like you have .notify() - I return a result object with a "changed" flag, etc.

I really like python as well (definitely one of my weapons of choice for one-off scripts)