- name: disable instance on HAproxy and wait for it to go offline
haproxy: state=disabled backend=app_back host={{ inventory_hostname_short }} socket=/run/haproxy/admin.sock shutdown_sessions=no wait=yes
delegate_to: “{{ item }}”
with_items: groups.haproxy_app
The haproxy_app group has 3 instances (hap01 … hap03), and the main playbook is executed on 10 instances, and it’s sequential, app01 to app10.
Let’s say the main playbook is now executed on app01, and it hits the haproxy task. Is the haproxy task going to be delegated to all haproxy instances at once, in parallel (from the p.o.v. of app01), or is it going to be executed sequentially, hap01, then hap02, then hap03?
Again, I am talking from the p.o.v. of each app instance where the main playbook is being executed.
The reason why I’m asking: This is the task which disables an app instance in HAproxy, and I would like each app to be disabled more or less at once on all proxies (in parallel). I want to avoid, as much as possible, the slower sequential process where an app instance is disabled on each proxy sequentially, one by one.