ansible - Is it possible to execute each task inside a playbbok in a different host? -


i have playbook 2 tasks. want execute first on my_machine1 , second in my_machine2. possible? want synchronous: since first task has not finished don't want second starts.

thanks in advance.

you looking delegation

you can use delegate_to keyword on task make run on other host this:

- name: take out of load balancer pool   command: /usr/bin/take_out_of_pool {{ inventory_hostname }}   delegate_to: 127.0.0.1 

as pointed out in documentation

using ‘serial’ keyword control number of hosts executing @ 1 time idea


Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -

Python Pig Latin Translator -