2016-02-10 18:51:39 +08:00
|
|
|
---
|
2021-04-29 20:20:50 +08:00
|
|
|
- hosts: kube_node
|
2019-04-18 16:42:10 +08:00
|
|
|
become: False
|
2016-02-10 18:51:39 +08:00
|
|
|
|
|
|
|
tasks:
|
|
|
|
- name: Gather EC2 facts
|
|
|
|
action: ec2_facts
|
|
|
|
|
|
|
|
- name: Terminate EC2 instances
|
2019-05-01 15:38:55 +08:00
|
|
|
ec2:
|
2016-02-13 22:16:28 +08:00
|
|
|
aws_access_key: "{{ aws_access_key }}"
|
|
|
|
aws_secret_key: "{{ aws_secret_key }}"
|
2016-02-10 18:51:39 +08:00
|
|
|
state: absent
|
|
|
|
instance_ids: "{{ ansible_ec2_instance_id }}"
|
|
|
|
region: "{{ ansible_ec2_placement_region }}"
|
|
|
|
wait: True
|
2019-05-01 15:38:55 +08:00
|
|
|
delegate_to: localhost
|
2020-06-25 23:14:38 +08:00
|
|
|
connection: local
|