Register same instance in more than one ELB in parallel using ec2_elb

16 views
Skip to first unread message

ivan farre Vicente

unread,
Jan 13, 2017, 6:57:12 AM1/13/17
to Ansible Project
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
Reply all
Reply to author
Forward
0 new messages