5 - zone in ('pub', 'priv')
7 - elb_type|default('') in ('', 'internal', 'internet-facing')
10 - name: determine subnets for ELB
12 region: "{{ vpc_region }}"
14 vpc_id: "{{ vpc.vpc.id }}"
15 "tag:zone": "{{ zone }}"
16 register: elb_subnet_ids
18 - name: module IAM role
24 - name: module ELB securitygroup
25 when: elb_type is defined
27 vpc_id: "{{ vpc.vpc.id }}"
28 region: "{{ vpc_region }}"
30 name: "{{ module }}-{{ (elb_type == 'internal')|ternary('int', 'ext') }}-elb"
31 description: "sg for {{ (elb_type == 'internal')|ternary('internal', 'external') }} elb for {{ module }}"
33 rules: "{{ elb_rules }}"
38 - name: module securitygroup
40 vpc_id: "{{ vpc.vpc.id }}"
41 region: "{{ vpc_region }}"
44 description: "{{ module }} rules"
46 rules: "{{ sg_rules }}"
53 when: elb_type is defined
55 region: "{{ vpc_region }}"
57 name: "{{ module }}-{{ (elb_type == 'internal')|ternary('int', 'ext') }}-elb"
58 cross_az_load_balancing: yes
59 scheme: "{{ elb_type }}"
60 subnets: "{{ elb_subnet_ids.subnets|default([])|map(attribute='id')|list }}"
62 - "{{ module }}-{{ (elb_type == 'internal')|ternary('int', 'ext') }}-elb"
63 listeners: "{{ elb_listeners }}"
64 health_check: "{{ elb_healthcheck }}"
65 register: loadbalancer
71 - "{{ sg_ssh.group_id }}"
72 - "{{ sg_icmp.group_id }}"
73 - "{{ sg_module.group_id }}"
76 name: autoscalinggroup
78 load_balancers: "{{ loadbalancer.elb.name|default(omit) }}"