-
Notifications
You must be signed in to change notification settings - Fork 343
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: instance_type should not be required to start/stop instances #980
Comments
@rbobrowicz Thank you for bringing this. Feel free to open a pull request with this contribution. Add a changelog fragment also please. |
ansibullbot
added
bug
This issue/PR relates to a bug
module
module
needs_triage
plugins
plugin (any type)
python3
labels
Aug 26, 2022
rbobrowicz
added a commit
to rbobrowicz/amazon.aws
that referenced
this issue
Aug 29, 2022
Specifying instance_type should not be required unless count or exact_count are specified. Fixes ansible-collections#980
softwarefactory-project-zuul bot
pushed a commit
that referenced
this issue
Sep 6, 2022
Fix deprecation warning on instance_type SUMMARY Specifying instance_type should not be required unless count or exact_count are specified. If the user is just trying to start/stop instances then we don't need to ask for size. Fixes #980 ISSUE TYPE Bugfix Pull Request COMPONENT NAME ec2_instance ADDITIONAL INFORMATION Reviewed-by: Gonéri Le Bouder <[email protected]> Reviewed-by: Alina Buzachis <None> Reviewed-by: Brian Scholer <None>
patchback bot
pushed a commit
that referenced
this issue
Sep 6, 2022
Fix deprecation warning on instance_type SUMMARY Specifying instance_type should not be required unless count or exact_count are specified. If the user is just trying to start/stop instances then we don't need to ask for size. Fixes #980 ISSUE TYPE Bugfix Pull Request COMPONENT NAME ec2_instance ADDITIONAL INFORMATION Reviewed-by: Gonéri Le Bouder <[email protected]> Reviewed-by: Alina Buzachis <None> Reviewed-by: Brian Scholer <None> (cherry picked from commit d80ab5b)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary
Hello,
I have some old ansible scripts using the old
ec2
module that I'm updating to use the newec2_instance
module and I'm getting some deprecation warnings that I think don't really make sense. What I'm essentially trying to do is to start/stop instances matching a tag. I have these scripts to do this:and
When I run these I get this deprecation warning:
However, requiring
instance_type
doesn't really make much sense to me becasue I'm not trying to create, re-create or re-size any instances. I'm just tring to turn them on and off. Even specifying a dummy value would be a bit weird since the intances I'm turning on/off are of various sizes.Examining the code, it looks like the warning is given for any state that is not
absent
: https://github.com/ansible-collections/amazon.aws/blob/main/plugins/modules/ec2_instance.py#L2053I think the specifying
instance_type
orlaunch_template
should only be required if you also specifycount
orexact_count
, since that would be the only time new instances would or could be launched. If neither is present, theninstance_type
is not needed as far as I can tell.So, I propose that the conditional for the warning be change to something like:
Let me know if this is acceptable or if you have other ideas or comments. I could prepare a patch if my suggestion is acceptable.
Issue Type
Bug Report
Component Name
ec2_instance
Ansible Version
Collection Versions
AWS SDK versions
Configuration
OS / Environment
Ubuntu 22.04
Steps to Reproduce
Expected Results
Tasks run with no warning or depracations.
Actual Results
Code of Conduct
The text was updated successfully, but these errors were encountered: