by theonemind · 6y ago · 0 comments
https://en.wikipedia.org/wiki/Infrastructure_as_code#Communi... the space has a lot of players. For upgrading like one VPS and some home servers, I'd probably go with Ansible. It probably has the lowest barrier to entry, and getting an IDE just solves the problem that you created by wanting something in Python. Basic config management doesn't need an IDE.
#!/bin/bash
rm -f /etc/bar
mkdir -p /etc/conf.d
cp -u /srv/src.txt /etc/conf.d/
because Anisble playbook is really just bunch of following statements if (!stuff_exists(stuff))
create_stuff()
which the above utilities in Bash script do with the provided flags.Ansible "declarativeness" isn't anything worthy of worship. It's plain dumb definition of sequence of steps to take with added guard for each step.
So let's be honest and stop pretending that this "declarativeness" is anything novel or of any value worthy of writing sequence of (guarded) commands in ad-hoc YAML language. Just add some sugar for the pattern above to a decent language and that's all that's needed.