-
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
ec2_vol doesn't report volume changes properly #482
Comments
Files identified in the description:
If these files are inaccurate, please update the |
Hi @lowlydba Thanks again |
PRs are always welcome. If you've taken "the wrong" approach we'll generally try to explain why and what the better approach would be. A couple of things to speed up the approval/merging of the PR:
|
ec2_vol: Fix incorrectly returned changed result SUMMARY When modify_volume is used but no new disk is being attached, the module incorrectly reports that no change has occurred even when disks have been modified (iops, throughput, type, etc.). This is due to the attach function overwriting the changed variable even if no disks are attached. Fixes #482 The integration test has been fixed so that when the gp3 modifications are tested, the volume is already in an attached state (previously detached) when reporting back changed. The detach tests are moved further down now, allowing this case to be properly covered by the existing assert: amazon.aws/tests/integration/targets/ec2_vol/tasks/tests.yml Lines 384 to 387 in e8df917 - name: check that volume_type has changed assert: that: - changed_gp3_volume.changed ISSUE TYPE Bugfix Pull Request COMPONENT NAME ec2_vol Reviewed-by: Alina Buzachis <None> Reviewed-by: None <None> Reviewed-by: Mark Chappell <None> Reviewed-by: None <None>
ec2_vol: backport fix incorrectly returned changed result SUMMARY Backport version of #483 When modify_volume is used but no new disk is being attached, the module incorrectly reports that no change has occurred even when disks have been modified (iops, throughput, type, etc.). This is due to the attach function overwriting the changed variable even if no disks are attached. Fixes #482 The integration test has been fixed so that when the gp3 modifications are tested, the volume is already in an attached state (previously detached) when reporting back changed. The detach tests are moved further down now, allowing this case to be properly covered by the existing assert: amazon.aws/tests/integration/targets/ec2_vol/tasks/tests.yml Lines 384 to 387 in e8df917 - name: check that volume_type has changed assert: that: - changed_gp3_volume.changed ISSUE TYPE Bugfix Pull Request COMPONENT NAME ec2_vol Depends-On: #491 Reviewed-by: Mark Chappell <None> Reviewed-by: Alina Buzachis <None> Reviewed-by: None <None>
ec2_asg: Add purge_tags to AutoScalingGroups. SUMMARY Add purge_tags to ec2_asg module. Fixes ansible-collections#481. ISSUE TYPE Feature Pull Request COMPONENT NAME ec2_asg ADDITIONAL INFORMATION There was another PR (currently closed) ansible-collections#482 - with similar functionality but I'm not sure if having modules to handle tags for individual services/modules is a good way to have this functionality. It will certainly cause increase in number of modules. Hence tried modifying existing ec2_asg module to be able to do this. This utilizes underlying API calls to: https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_DescribeTags.html https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_CreateOrUpdateTags.html https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_DeleteTags.html Reviewed-by: Alina Buzachis <None> Reviewed-by: Jill R <None> Reviewed-by: Mandar Kulkarni <[email protected]>
ec2_asg: Add purge_tags to AutoScalingGroups. SUMMARY Add purge_tags to ec2_asg module. Fixes ansible-collections#481. ISSUE TYPE Feature Pull Request COMPONENT NAME ec2_asg ADDITIONAL INFORMATION There was another PR (currently closed) ansible-collections#482 - with similar functionality but I'm not sure if having modules to handle tags for individual services/modules is a good way to have this functionality. It will certainly cause increase in number of modules. Hence tried modifying existing ec2_asg module to be able to do this. This utilizes underlying API calls to: https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_DescribeTags.html https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_CreateOrUpdateTags.html https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_DeleteTags.html Reviewed-by: Alina Buzachis <None> Reviewed-by: Jill R <None> Reviewed-by: Mandar Kulkarni <[email protected]>
ec2_asg: Add purge_tags to AutoScalingGroups. SUMMARY Add purge_tags to ec2_asg module. Fixes ansible-collections#481. ISSUE TYPE Feature Pull Request COMPONENT NAME ec2_asg ADDITIONAL INFORMATION There was another PR (currently closed) ansible-collections#482 - with similar functionality but I'm not sure if having modules to handle tags for individual services/modules is a good way to have this functionality. It will certainly cause increase in number of modules. Hence tried modifying existing ec2_asg module to be able to do this. This utilizes underlying API calls to: https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_DescribeTags.html https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_CreateOrUpdateTags.html https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_DeleteTags.html Reviewed-by: Alina Buzachis <None> Reviewed-by: Jill R <None> Reviewed-by: Mandar Kulkarni <[email protected]>
Summary
When
modify_volume
is used but no new disk is being attached, the module incorrectly reports that no change has occurred even when disks have been modified (iops, throughput, type, etc.). This is due to the attach function overwriting thechanged
variable even if no disks are attached:amazon.aws/plugins/modules/ec2_vol.py
Lines 812 to 830 in e8df917
Locally I have used the following workaround as a fix:
I am happy to make a PR with this change if this is an acceptable route to go down.
Issue Type
Bug Report
Component Name
ec2_vol
Ansible Version
ansible 2.9.9
Collection Versions
AWS SDK versions
Configuration
N/A
OS / Environment
MacOS
Steps to Reproduce
Run something similar to the above example to upgrade an existing attached gp2 volume to gp3, along with non-default iops and throughput. The module will make the changes correctly but mark the volume as "ok" instead of "changed" in the results.
Expected Results
I expect the module to report back
changed: true
when modifying the type, iops, etc. of an already-attached ebs volume.Actual Results
Module reports
changed: false
when modifying the type, iops, etc. of an already-attached ebs volume.Code of Conduct
The text was updated successfully, but these errors were encountered: