- name: Get instance id
  command: ec2metadata --instance-id
  register: instanceId

- name: ELB register instance
  local_action:
    module: ec2_elb
    instance_id: "{{ instanceId.stdout }}"
    ec2_elbs: "{{ elb_name }}"
    state: present
    region: "{{ region }}"
    wait: true
    wait_timeout: 120

 ...