Skip to content
Discussion options

You must be logged in to vote

I think I finally understood the key point about delegate_to, and why you couldn’t find an equivalent in pyinfra.

In Ansible, a task still belongs to the current host (loop/context), but is executed on another host via delegate_to. So you get this mix of “who the task is for” vs “where it runs”.

In pyinfra, there’s no such split: an operation always runs on the host it targets. If you want something to happen on another host, you just target that host directly. There’s no concept of “delegating” mid-task.

So rather than trying to replicate delegate_to, the intended approach in pyinfra is to structure your deploy so that each operation is applied to the right hosts explicitly (and split st…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@dvdkon
Comment options

Answer selected by dvdkon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants