1,319 karma · joined Jan 11, 2012 (14y ago) · 402 submissions
Blog: pointlessramblings.com Email: nick@<username>.com
comment 1y ago · link · parent
Not only does it feel like the most correct (I don’t think there is a perfect) behaviour for the user but also makes implementation much simpler. Synapse has a LOT of ordering foo and magic in the code I still don’t fully understand and I’ve gone fairly deep into synapse at times for work.
comment 2y ago · link · parent
comment 2y ago · link · parent
I have also used cursor to write Kubernetes client code with great success because the API space is so large it doesn’t fit into my head that well (not often writing such code these days) so that has been incredibly helpful.
So it’s not revolutionising my workflow but certainly a useful tool in some situations.
comment 2y ago · link · parent
Amazing, properly savage; I love this.
comment 2y ago · link · parent
comment 2y ago · link · parent
Alternatively you could just yield ansible cli and execute from the local machine using the @local connector.
comment 2y ago · link · parent
comment 2y ago · link · parent
comment 2y ago · link · parent
I chose Python because it’s what I was writing all day back in 2015. Which makes me realise pyinfra is almost 10!
Edit: I mostly write Go or YAML (k8s) these days but Python still makes an appearance from time to time (outside of pyinfra dev).
comment 2y ago · link · parent
But there’s always edge cases and situations that doesn’t work which is why pyinfra supports both and they can combine any way you like.
comment 2y ago · link · parent
Totally agree on templating which is why inventories have always been python code just as operations, giving maximum flexibility (with some complexity/type confusion drawbacks).
comment 2y ago · link · parent
- state definitions, "ensure this apt package is installed" (apt.packages: https://docs.pyinfra.com/en/next/operations/apt.html#operati...) - stateless, "run these shell commands" (server.shell: https://docs.pyinfra.com/en/next/operations/server.html#oper...)
Most operations are state definitions and much preferred, the stateless ones exist to satisfy edge cases where either the state-ful version isn't implemented or simply isn't possible.
comment 2y ago · link · parent
comment 2y ago · link · parent
comment 2y ago · link · parent
Yes
> Is it meant for running one-off commands across the infrastructure, like Salt?
Also yes.
> It says it integrates with Terraform, so it's not a provisioning tool...
The TF integration is specifically to use TF as an inventory source - ie TF to create resources and pyinfra to then configure them.
> What does it do different (and presumably better) than other tools?
The homepage covers the highlights, I originally created pyinfra because debugging Ansible was complicated (no plain stderr as not "just" commands on the remote side) and slow, but things have evolved significantly since then.
> The Getting Started guide doesn't cover this. The FAQ doesn't cover this, and the Docs doesn't have an Introductory section to cover this.
Hugely appreciate this feedback, this is super helpful and something I will attempt to make clearer.
---
Quick attempt at a better explanation: You write Python code that defines operations (either state "this apt package should be installed" or stateless "run this command"), provide an inventory of targets (SSH, local machine) and pyinfra executes it.
Roughly sits where Ansible does for configuring servers, but also solves the case of "how do I run this command across my server fleet" (which I believe Ansible can also do).
comment 2y ago · link · parent
I also hang out on the Matrix room: https://matrix.to/#/#pyinfra:matrix.org
Another thing: the GH repo points at currently in beta v3 and the docs for this are here: https://docs.pyinfra.com/en/next (highly recommend starting with v3, I just haven't had any time recently to wrap up the release, but it's stable).
117.
Ceph SQLite VFS(docs.ceph.com ↗)
16 points · by Fizzadar · 2y ago · 2 comments
118.
AT&T confirms data breach and resets customer passcodes(theverge.com ↗)
60 points · by Fizzadar · 2y ago · 21 comments
comment 2y ago · link · parent
For ansible/chef, etc the main reasons/benefits boil down to:
- instant feedback esp on errors, get the stdout/stderr of whatever command pyinfra was executing, there’s no agent or abstraction to hide it
- configure in python rather than yaml+jinja2 mess
- integrate with the whole python package ecosystem
- speed and small overhead as inventories scale
comment 2y ago · link · parent
- ops are (mostly) declarative, but some (server.shell) will always execute the command given
- inventory is just that, basically a list of hosts to target plus associated data, docs page: https://docs.pyinfra.com/en/2.x/inventory-data.html
- absolutely for syncing files, check out the files.put and files.template operations (and the files ops in general): https://docs.pyinfra.com/en/2.x/operations/files.html