An also full example of the script
- name: Create ELBs
      #connection: local
      local_action:
        module: ec2_elb_lb
        aws_access_key: "{{ AWS_ACCESS_KEY_ID }}"
        aws_secret_key: "{{ AWS_SECRET_ACCESS_KEY }}"
        name: "{{ item.name }}{{ item.elb_id }}"
        state: present
        connection_draining_timeout: 60
        cross_az_load_balancing: true
        region: eu-west-1
        zones:
          - eu-west-1a
          - eu-west-1b
          - eu-west-1c
        listeners:
          - protocol: http
            load_balancer_port: 80
            instance_port: 80
        health_check:
            ping_protocol: tcp
            ping_port: 22
            response_timeout: 5 # seconds
            interval: 30 # seconds
            unhealthy_threshold: 2
            healthy_threshold: 5
      with_items:
        - { name: 'TEST-ELB-', elb_id: "01" }
        - { name: 'TEST-ELB-', elb_id: "02" }
        - { name: 'TEST-ELB-', elb_id: "03" }
        - { name: 'TEST-ELB-', elb_id: "04" }
        - { name: 'TEST-ELB-', elb_id: "05" }
        - { name: 'TEST-ELB-', elb_id: "06" }
        - { name: 'TEST-ELB-', elb_id: "07" }
        - { name: 'TEST-ELB-', elb_id: "08" }
        - { name: 'TEST-ELB-', elb_id: "09" }
        - { name: 'TEST-ELB-', elb_id: "10" }
        - { name: 'TEST-ELB-', elb_id: "11" }
        - { name: 'TEST-ELB-', elb_id: "12" }
        - { name: 'TEST-ELB-', elb_id: "13" }
        - { name: 'TEST-ELB-', elb_id: "14" }
        - { name: 'TEST-ELB-', elb_id: "15" }
      register: ec2_result
      # If instance does not start, try to start it again
      until: ec2_result|success
      retries: 10
      delay: 5

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/f5b9914a-1c2c-44fa-8ca7-cd13b1126656%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to