The first task will be to disable the host from the load balancer. The load balancer runs on the
foo-lb host; however, we're operating on the
foo-app hosts. Therefore, we need to delegate the task using the
delegate_to task operator. This operator redirects where Ansible will connect in order to execute the task, but keeps all the variable context of the original host. We'll use the
haproxy module to disable the current host from the
foo-app backend pool:
tasks: - name: disable member in balancer haproxy: bac...
Share this highlighthttp://www.safaribooksonline.com/a/mastering-ansible/688523/