You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
421 B

  1. ---
  2. - hosts: kube-node
  3. become: False
  4. tasks:
  5. - name: Gather EC2 facts
  6. action: ec2_facts
  7. - name: Terminate EC2 instances
  8. ec2:
  9. aws_access_key: "{{ aws_access_key }}"
  10. aws_secret_key: "{{ aws_secret_key }}"
  11. state: absent
  12. instance_ids: "{{ ansible_ec2_instance_id }}"
  13. region: "{{ ansible_ec2_placement_region }}"
  14. wait: True
  15. delegate_to: localhost
  16. connection: local