lib/templates/destroy-old-nodes.yaml.mustache
---
- name: terminate old instances
hosts: all
vars:
region: '{{{ region }}}'
tasks:
- action: ec2_facts
- name: terminating old instances
local_action:
module: ec2
state: 'absent'
region: '{{=<% %>=}}{{ ansible_ec2_placement_region }}<%={{ }}=%>'
keypair: '{{{ keypair }}}'
instance_ids: "{{=<% %>=}}{{ ansible_ec2_instance_id }}<%={{ }}=%>"