From 2a4e9f0776824709dd696e965072a0546060d7e1 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Tue, 12 Apr 2022 12:45:21 +0000 Subject: [PATCH] [PR #606/038c0474 backport][stable-1.5] ec2_vol: set iops even if unchanged for boto req (#614) [PR #606/038c0474 backport][stable-1.5] ec2_vol: set iops even if unchanged for boto req Depends-On: #753 This is a backport of PR #606 as merged into main (038c047). SUMMARY Set the iops value in req_obj even if the target iops is the same as the existing. This is a required parameter for boto's modify_volume. Fixes #605 ISSUE TYPE Bugfix Pull Request COMPONENT NAME ec2_vol --- .../606-ec2_vol-set-iops-even-if-unchanged-for-boto-req.yml | 5 +++++ plugins/modules/ec2_vol.py | 2 ++ tests/integration/constraints.txt | 0 3 files changed, 7 insertions(+) create mode 100644 changelogs/fragments/606-ec2_vol-set-iops-even-if-unchanged-for-boto-req.yml create mode 100644 tests/integration/constraints.txt diff --git a/changelogs/fragments/606-ec2_vol-set-iops-even-if-unchanged-for-boto-req.yml b/changelogs/fragments/606-ec2_vol-set-iops-even-if-unchanged-for-boto-req.yml new file mode 100644 index 00000000000..c3c1580d463 --- /dev/null +++ b/changelogs/fragments/606-ec2_vol-set-iops-even-if-unchanged-for-boto-req.yml @@ -0,0 +1,5 @@ +bugfixes: +- >- + ec2_vol - Sets the Iops value in req_obj even if the iops value + has not changed, to allow modifying volume types that require + passing an iops value to boto. (https://github.com/ansible-collections/amazon.aws/pull/606) diff --git a/plugins/modules/ec2_vol.py b/plugins/modules/ec2_vol.py index a7b7990c916..ffbc94f176f 100644 --- a/plugins/modules/ec2_vol.py +++ b/plugins/modules/ec2_vol.py @@ -373,6 +373,8 @@ def update_volume(module, ec2_conn, volume): if target_iops != original_iops: iops_changed = True req_obj['Iops'] = target_iops + else: + req_obj['Iops'] = original_iops else: # If no IOPS value is specified and there was a volume_type update to gp3, # the existing value is retained, unless a volume type is modified that supports different values, diff --git a/tests/integration/constraints.txt b/tests/integration/constraints.txt new file mode 100644 index 00000000000..e69de29bb2d