Hello,
I am new to Ansible and I couldn't figure out what is wrong with my ansible playbook.
I simply want to list all instances associated with specific elastic load balancers and then de-register them all.
Can you please take a look at it and tell me what am I doing wrong?
---
- hosts: localhost
tasks:
- name: fetch
ec2_elb_facts:
names: jjbeans-prod
region: us-west-2
register: elb_facts
- debug: var=elb_facts
- name: De-register instances from ELB
ec2_elb:
instances_id: "{{ item.instances }}"
region: us-west-2
state: absent
with_items: "{{ elb_facts.elbs }}"