I am working with Ansible and just accidentally terminated 4 ec2 instances
out of 20+ in AWS and I'm trying to figure out the why as to what was
deleted. I have already determined that the code I originally used was
wrong, but wish to understand what happened. The quasi code in question
was/is:
- name: Create EC2
ec2:
key_name: key
instance_type: t2.medium
image: actual_amiID
wait: yes
region: us-east-1
vpc_subnet_id: actual_subnetID
instance_tags: { "Name":"vpc03VM01" }
group_id: actual_securitygroupID
count_tag: (or count_tag: 1)
exact_count: 1
I'm not 100% sure that count_tag was empty it may have been 1. 4 instances
were destroyed, it tried to destroy a 5th, but it had protection. All of
them had some tags, only one of them had the Name tag in question, but two
of the other ones were named similarly ( vpc01VM01 / vpc02VM01 ), the other
three (including the one that wasn't destroyed because of protections) were
named differently. I want to understand why these instances were
terminated and the one that I was trying to create wasn't created. I was
trying to use the count_tag and exact_count to be similar in functionality
to "state: present."
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/e06a5fdf-27b1-4776-92b9-6d45ca6377a0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.