2016-02-10 10:51:39 +00:00
|
|
|
---
|
|
|
|
- hosts: kube-node
|
2019-04-18 08:42:10 +00:00
|
|
|
become: False
|
2016-02-10 10:51:39 +00:00
|
|
|
|
|
|
|
tasks:
|
|
|
|
- name: Gather EC2 facts
|
|
|
|
action: ec2_facts
|
|
|
|
|
|
|
|
- name: Terminate EC2 instances
|
|
|
|
local_action:
|
|
|
|
module: ec2
|
2016-02-13 14:16:28 +00:00
|
|
|
aws_access_key: "{{ aws_access_key }}"
|
|
|
|
aws_secret_key: "{{ aws_secret_key }}"
|
2016-02-10 10:51:39 +00:00
|
|
|
state: absent
|
|
|
|
instance_ids: "{{ ansible_ec2_instance_id }}"
|
|
|
|
region: "{{ ansible_ec2_placement_region }}"
|
|
|
|
wait: True
|