AWS deregister ec2 instance from ELB

44 views
Skip to first unread message

Cann

unread,
Aug 15, 2016, 10:19:27 AM8/15/16
to Ansible Project
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 }}"


Hao Cheng Lee

unread,
Aug 19, 2016, 11:44:05 AM8/19/16
to Ansible Project
Hi Cann, 

What's the error message?

Cheers
Reply all
Reply to author
Forward
0 new messages