We have the same instances behind a group of ELB’s. During deploy we register them using ec2_elb module like this
- name: Instance Register
tags: balancer,balancer-register
environment: “{{ aws_env }}”
local_action:
module: ec2_elb
region: eu-west-1
instance_id: “{{ ansible_ec2_instance_id }}”
ec2_elbs: “{{ item }}”
wait_timeout: 300
state: present
with_items: “{{ elbs }}”
register: register_elbs
until: register_elbs|success
retries: 3
delay: 5
Where elbs var is a list strings with the name of ELB’s affected.
We tried to use loop_control var to register in parallel without successful. Maybe we should invoke this task in different way.
Some one achieve this manner of add the same instance across multiple ELB’s?
Thanks