News for hackers. Stuff that matters.
Re:Ansible Alternatives in Python by theonemind on Saturday June 13, 2020 @02:49AM (#23507401)
"In Python" seems like a weird constraint on the problem. Python doesn't really read like a great deployment configuration language.

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.

Re:Ansible Alternatives in Python by divbzero on Saturday June 13, 2020 @03:41AM (#23507645)
“In Python” does seem like an odd constraint. I take the OP’s intent to be “let’s find something imperative not declarative”. If that’s the case, I’d love to see the idempotent functionality of Ansible’s modules (e.g. lineinfile) made available as simple CLI commands.
Re:Ansible Alternatives in Python by inshadows on Saturday June 13, 2020 @10:31AM (#23509610)
I assume you consider Ansible to be "declarative". By that definition of "declarative", the following Bash script is also "declarative":

    #!/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.

Re:Ansible Alternatives in Python by Bystroushaak on Saturday June 13, 2020 @06:45PM (#23513484)
Op is python programmer who is using python for everything for more than 13 years, so there you have the reason. I am also writing my own programming language .. in python: https://github.com/Bystroushaak/tinySelf
Re:Ansible Alternatives in Python by stonith on Saturday June 13, 2020 @06:29AM (#23508440)
You could kind of do this using ansible-runner to dynamically generate a playbook that does what you want.