elb.yml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. ---
  2. - name: query vpc
  3. ec2_vpc_net_facts:
  4. region: "{{ openshift_aws_region }}"
  5. filters:
  6. 'tag:Name': "{{ openshift_aws_vpc_name }}"
  7. register: vpcout
  8. - name: debug
  9. debug: var=vpcout
  10. - name: fetch the default subnet id
  11. ec2_vpc_subnet_facts:
  12. region: "{{ openshift_aws_region }}"
  13. filters:
  14. "tag:Name": "{{ openshift_aws_subnet_name }}"
  15. vpc-id: "{{ vpcout.vpcs[0].id }}"
  16. register: subnetout
  17. - name: dump the elb listeners
  18. debug:
  19. msg: "{{ openshift_aws_elb_listeners[openshift_aws_node_group_type][openshift_aws_elb_direction]
  20. if 'master' in openshift_aws_node_group_type or 'infra' in openshift_aws_node_group_type
  21. else openshift_aws_elb_listeners }}"
  22. - name: "Create ELB {{ l_openshift_aws_elb_name }}"
  23. ec2_elb_lb:
  24. name: "{{ l_openshift_aws_elb_name }}"
  25. state: present
  26. cross_az_load_balancing: "{{ openshift_aws_elb_az_load_balancing }}"
  27. security_group_names: "{{ openshift_aws_elb_security_groups }}"
  28. idle_timeout: "{{ openshift_aws_elb_idle_timout }}"
  29. region: "{{ openshift_aws_region }}"
  30. subnets:
  31. - "{{ subnetout.subnets[0].id }}"
  32. health_check: "{{ openshift_aws_elb_health_check }}"
  33. listeners: "{{ openshift_aws_elb_listeners[openshift_aws_node_group_type][openshift_aws_elb_direction]
  34. if 'master' in openshift_aws_node_group_type or 'infra' in openshift_aws_node_group_type
  35. else openshift_aws_elb_listeners }}"
  36. scheme: "{{ openshift_aws_elb_scheme }}"
  37. tags: "{{ openshift_aws_elb_tags }}"
  38. register: new_elb
  39. - debug:
  40. msg: "{{ item }}"
  41. with_items:
  42. - "{{ new_elb }}"