elb_single.yml 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. ---
  2. - name: "dump the elb listeners for {{ item.key }}"
  3. debug:
  4. msg: "{{ item.value }}"
  5. verbosity: 1
  6. - name: "Create ELB {{ item.value.name }}"
  7. ec2_elb_lb:
  8. name: "{{ item.value.name }}"
  9. state: present
  10. cross_az_load_balancing: "{{ item.value.cross_az_load_balancing }}"
  11. security_group_names: "{{ l_elb_security_groups[l_elb_dict_item.key] }}"
  12. idle_timeout: "{{ item.value.idle_timeout }}"
  13. region: "{{ openshift_aws_region }}"
  14. subnets: "{{ subnetout.results | map(attribute='subnets.0.subnet_id') | list }}"
  15. health_check: "{{ item.value.health_check }}"
  16. instance_ids: "{{ item.value.instance_ids | default(omit) }}"
  17. listeners: "{{ item.value.listeners }}"
  18. scheme: "{{ (item.key == 'internal') | ternary('internal','internet-facing') }}"
  19. tags: "{{ item.value.tags }}"
  20. wait: True
  21. register: new_elb
  22. retries: 20
  23. delay: 5
  24. until: new_elb is succeeded
  25. ignore_errors: yes
  26. - fail:
  27. msg: "couldn't create ELB {{ item.value.name }}"
  28. when: new_elb is failed
  29. - debug:
  30. msg: "{{ new_elb }}"
  31. verbosity: 1