-
Notifications
You must be signed in to change notification settings - Fork 342
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
ec2_instance updates exisitng instances instead of creating new #526
Comments
Files identified in the description:
If these files are inaccurate, please update the |
Hi @poleszcz, Thank you for opening this. There is no top level |
…meter if no name and no filter provided fixes: ansible-collections#526
@poleszcz The documentation currently says (under 'filters')
What's slightly confusing here is that currently the 'Name' tag that it compares is only read from the name parameter, rather that also looking at the 'Name' key in the tags parameter. |
@goneri Thanks for the hint - top level parameter "name" does the job.
|
(1) Will be updated when release 2.0.0 of this collection is a part of the latest version of Ansible |
…meter if no name and no filter provided (#529) ec2_instance When searching for instances fall back to tag(Name) parameter if no name and no filter provided SUMMARY Reported in #526 When the name parameter isn't set but the Name tag is set the Name tag is ignored when searching for existing instances. The documentation states: - By default, instances are filtered for counting by their "Name" tag, base AMI, state (running, by default), and subnet ID. As such I think we should consider this a bug. ISSUE TYPE Bugfix Pull Request COMPONENT NAME ec2_instance ADDITIONAL INFORMATION fixes: #526 Reviewed-by: Alina Buzachis <None> Reviewed-by: None <None>
…ns#526) * ec2_instance exception handling and client cleanup Catch botocore and client errors on all API calls Pass boto client to functions, rather than creating new clients throughout the code * Add review suggestion to plugins/modules/ec2_instance.py Co-authored-by: Mark Chappell <[email protected]>
…ns#526) * ec2_instance exception handling and client cleanup Catch botocore and client errors on all API calls Pass boto client to functions, rather than creating new clients throughout the code * Add review suggestion to plugins/modules/ec2_instance.py Co-authored-by: Mark Chappell <[email protected]>
…ns#526) * ec2_instance exception handling and client cleanup Catch botocore and client errors on all API calls Pass boto client to functions, rather than creating new clients throughout the code * Add review suggestion to plugins/modules/ec2_instance.py Co-authored-by: Mark Chappell <[email protected]>
…ns#526) * ec2_instance exception handling and client cleanup Catch botocore and client errors on all API calls Pass boto client to functions, rather than creating new clients throughout the code * Add review suggestion to plugins/modules/ec2_instance.py Co-authored-by: Mark Chappell <[email protected]>
In my case, both community.aws and amazon.aws are installed and is misbehaving where even after specifying count, it was selecting existing instances also in addition to launching a new one. Specifying |
This is clearly still an issue and the documentation is terrible. You'd expect more from a project like this. |
Summary
I'm using amazon.aws 2.0. I want to create new instance with module ec2_instance but instead ansible is updating other instances that use the same image. Apparently I'm missing something. Based on documentation I don't see how module is deciding to update or create new instance.
Collection Version
amazon.aws 2.0.0
Issue Type
Bug Report
Component Name
ec2_instance
Ansible Version
Collection Versions
AWS SDK versions
Configuration
$ ansible-config dump --only-changed
OS / Environment
local: MacOS
Steps to Reproduce
I have few preexisting instances and they are getting updated and new instance is not created.
Expected Results
I exepect to get new instance created.
Actual Results
ec2_instance returns list of 6 updated instances
Code of Conduct
The text was updated successfully, but these errors were encountered: