While it would be nice to have the core and the framework dissociated, stating that it provide no advantage over Ansible seems overly broad.
You can use python logic to compose your deployment scenario, use imports to reuse features, package modules the same way, etc. The whole ecosystem is also at your disposal, be it libraries, IDE support, linters, formatters, debuggers and so on.
It doesn't need to reinvent the wheel, and you don't need to learn a new syntax.
I would call that a win.
Now, is pyinfra well designed enough to be practical in production, that's another matter that needs testing.
Thanks for sharing Shlax, I didn't know about it, and at first glance, I like the design choices: encapsulate task, pass the target object so you can mock it for testing, use await to delegate I/O...
YAML is not a programming language, and deployment is not a toy task. You need power.
The result is that ansible has pushed a markup language to its limit, then pushed the templating engine used in it to its limit too. Then used a bunch of duck tape + conventions to glue everything and ended up with 10% of an unclean verbose unexpressive real programming language with ridiculous limited tooling, testability and had to document + support it.
As with most DSL.
For what? For the quest of having something "declarative", and that any language could read.
Well you can have declarative API written in any language, and nobody except ansible ever read playbooks.
In the end, it's just a big weight at the ankle. I never ever used it and though, "damn, what a pleasant tech choice, I'm happy they didn't directly expose the API through Python".
It's the same reason I use "nox" and not "tox", or "doit" and not "make". DSL really seem like a great idea, but they fail most of the time. There is a reason only few of them - like SQL, CSS or regex patterns - became a success. 99% of the time, what you need is a good lib, with a well designed API. For the 0.9% of the time you do need multi-language communication, you may implement RPC. Then, only for the 0.01% case should you really consider a DSL.
But we geek love to create DSL. They are fun to write! They are so elegant in tutorials!
Is Pyinfra doing better? I don't know, but I'm sure to give it a try. I really, really want to leave ansible behind, but fabric 2 is not high level or declarative enough.
I haven't checked it, but I think the worker stays up, and deal with several requests during its life time, not just one then die. Hence, there is pesistence.
> "man, why I have to type this silly whitespace?"
I assume it's a joke, but I often have people in my classroom that have been doing python for some times and that keep typing the whitespaces themselves instead of using an editor that does it for them.
But again, I've seen some coding without any syntax highlighting.
Now I never assume people know even the most obvious things.
The problem with make, is that it's yet another DSL to learn.
Every single tool in your toolbox could introduce a new one, and it leads to fatigue.
Task runner? New DSL (make)
Test runner? New DSL (robot)
Deployement? New DSL (Ansible)
Batch spawning? New DSL (tox)
Etc
Of course, dev in half of those DSL is a total pain, because, like with most DSL, the tooling sucks: terrible completion, linting, debugging or composing experience.
So people write/leverage tools they can use with their favorite language. And why not? You have to install it anyway (make isn't default on windows, it's not even installed on vanilla Ubuntu!).
It's in Python, the language of my projects. So I can use the same tooling, the same libs, the same install and testing procedures. And so can people contributing: no need to train them. Most devs don't know how to use make (most of them are on Windows after all).
Using make adds zero benefit for me: doit just does what make does (ok, that sentence is hard to parse :)). But make adds an extra step of asking to install it while I can just slip doit among my other python project dependancies. I have to google the syntax. I can't use tab to complete names, of right click to get documentation. And if (actually when) I need to debug my make file, God have mercy.
It's not against make. It just doesn't provide enough value to justify the cost of it.
Are you aware "PRISM-like programs" apply to every single US based webserving entity? Why are you calling Cloudflare out when there's thousands of companies who are subject to the very same risk? Is it possible that PRISM programs bear no relevance at all to this conversation?
You can use python logic to compose your deployment scenario, use imports to reuse features, package modules the same way, etc. The whole ecosystem is also at your disposal, be it libraries, IDE support, linters, formatters, debuggers and so on.
It doesn't need to reinvent the wheel, and you don't need to learn a new syntax.
I would call that a win.
Now, is pyinfra well designed enough to be practical in production, that's another matter that needs testing.