Skip to content

Instantly share code, notes, and snippets.

@farahfa
Created June 29, 2017 17:44
Show Gist options
  • Save farahfa/ed46167b1a26684e6dd2235af8d862b8 to your computer and use it in GitHub Desktop.
Save farahfa/ed46167b1a26684e6dd2235af8d862b8 to your computer and use it in GitHub Desktop.
- name: Create new Elastic Search load balancer if it doesn't exists
ec2_elb_lb:
name: "{{ elb_name }}"
state: present
region: "{{aws_region}}"
scheme: internal
subnets:
- "{{ elb_subnet_1 }}"
- "{{ elb_subnet_2 }}"
- "{{ elb_subnet_3 }}"
security_group_ids: "{{vpc_sg}}"
listeners:
- protocol: tcp
- load_balancer_port: 9600
- instance_port: 9600
stickiness:
type: loadbalancer
enabled: yes
expiration: 300
access_logs:
interval: 5 # minutes (defaults to 60)
s3_location: "{{ lb_log_location }}" # This value is required if access_logs is set
s3_prefix: "logstash"
cross_az_load_balancing: "yes"
# when: ' "{{lb_name}}" != "{{ elb_name }}" '
when: elb_name_output is undefined
@s-hertel
Copy link

Hi @farahfa. Does this problem persist if you specify listeners like this?

listeners:
  - protocol: tcp
    load_balancer_port: 9600
    instance_port: 9600

Right now your playbook reads as though it is designating three listeners rather than one listener with those three attributes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment