Using delegate_to in combination with roles in a playbook

Hi,

Is it possible to delegate the execution of an entire play to a another host?

I have a playbook that contains a set of reusable roles, the tasks in these roles will not generally be delegated. However in this case I need to run the entire playbook delegated to a different host.

So either I need mechanism to “globally” delegate the execution of my playbook, or else a way to mark each of the roles when included in my playbook to have all of their tasks similarly delegated.

Is this functionality supported by Ansible?

Thanks,

Paul.

Why not simply specify the ‘hosts:’ in that play as the ones you are wishing to delegate the tasks? If you need that to be more dynamic, you can use the group_by module to create the targeted group, and you can also use a variable for the ‘hosts:’.