-
Notifications
You must be signed in to change notification settings - Fork 341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Molecule Destroy ephemeral EC2 instances #2309
Comments
@matt-horwood-mayden Can you clarify what the problem is that you are having with the amazon.aws collection? You are passing a list of instance-ids to the ec2_instance module. Are you saying this task is deleting more than those instance ids? Can you provide the logs with verbose output enabled? |
Hi @gravesm We have been using molecule testing to re-write all our roles with Ansible 9, that all works great and looks to work as we want. But we had an instance created outside of Ansible and had no tags or name that would clash with Ansible molecule testing, but after someone had run So I did a test and made an instance from the webUI, then ran It seems that if you hand the |
OK, thanks, that clarifies things. The module does delete everything if the only filter you give it is an empty list of instance ids. In this case, the module isn't clear exactly what the intended behavior should be, but I think this is a bug as it shouldn't be so easy to do so. |
great, will work on some code to stop the list being empty or skip it |
Summary
when running molecule a molecule test, any instance not made with molecule is destroyed
Issue Type
Bug Report
Component Name
ec2_instance
Ansible Version
Collection Versions
AWS SDK versions
Configuration
OS / Environment
AWS CLI
Steps to Reproduce
Expected Results
when I run a destroy either nothing happens or
Actual Results
Code of Conduct
The text was updated successfully, but these errors were encountered: