Skip to content

Instantly share code, notes, and snippets.

@sidneiweber
Created December 27, 2019 21:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sidneiweber/9b3d8791ad11cf0a7ad798446b58b6d1 to your computer and use it in GitHub Desktop.
Save sidneiweber/9b3d8791ad11cf0a7ad798446b58b6d1 to your computer and use it in GitHub Desktop.
# cat roles/terminate/tasks/main.yml
- name: ensure instances are not running
ec2:
region: "{{ target_aws_region }}"
image: "{{ win_ami_id }}"
instance_type: "{{ instance_type }}"
group_id: "{{ sg_out.group_id }}"
key_name: "{{ keypair }}"
wait: yes
wait_timeout: 500
exact_count: 0
assign_public_ip: yes
vpc_subnet_id: "{{ subnet }}"
count_tag:
Name: stock-win-ami-test
instance_tags:
Name: stock-win-ami-test
register: ec2_result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment