From 5c9539903eec844e59fb5a729fcbfe63e79d682c Mon Sep 17 00:00:00 2001 From: Mark Chappell Date: Mon, 9 Dec 2019 10:38:43 +0100 Subject: [PATCH] iam_policy: Make 'iam_name' a required option to match the documentation (#65559) Without it we'd always throw a boto error --- changelogs/fragments/65559-iam_policy-require-iam_name.yml | 2 ++ lib/ansible/modules/cloud/amazon/iam_policy.py | 2 +- test/sanity/ignore.txt | 1 - 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 changelogs/fragments/65559-iam_policy-require-iam_name.yml diff --git a/changelogs/fragments/65559-iam_policy-require-iam_name.yml b/changelogs/fragments/65559-iam_policy-require-iam_name.yml new file mode 100644 index 00000000000..0242871ca40 --- /dev/null +++ b/changelogs/fragments/65559-iam_policy-require-iam_name.yml @@ -0,0 +1,2 @@ +minor_changes: +- iam_policy - make `iam_name` a required field. diff --git a/lib/ansible/modules/cloud/amazon/iam_policy.py b/lib/ansible/modules/cloud/amazon/iam_policy.py index 999affcafa3..8db58e083aa 100644 --- a/lib/ansible/modules/cloud/amazon/iam_policy.py +++ b/lib/ansible/modules/cloud/amazon/iam_policy.py @@ -292,7 +292,7 @@ def main(): argument_spec = dict( iam_type=dict(required=True, choices=['user', 'group', 'role']), state=dict(default='present', choices=['present', 'absent']), - iam_name=dict(default=None, required=False), + iam_name=dict(required=True), policy_name=dict(required=True), policy_document=dict(default=None, required=False), policy_json=dict(type='json', default=None, required=False), diff --git a/test/sanity/ignore.txt b/test/sanity/ignore.txt index 7453139360d..9bedd603e7e 100644 --- a/test/sanity/ignore.txt +++ b/test/sanity/ignore.txt @@ -492,7 +492,6 @@ lib/ansible/modules/cloud/alicloud/ali_instance.py validate-modules:parameter-ty lib/ansible/modules/cloud/alicloud/ali_instance_info.py validate-modules:doc-missing-type lib/ansible/modules/cloud/alicloud/ali_instance_info.py validate-modules:doc-required-mismatch lib/ansible/modules/cloud/alicloud/ali_instance_info.py validate-modules:parameter-type-not-in-doc -lib/ansible/modules/cloud/amazon/iam_policy.py validate-modules:doc-required-mismatch lib/ansible/modules/cloud/atomic/atomic_container.py validate-modules:doc-missing-type lib/ansible/modules/cloud/atomic/atomic_container.py validate-modules:doc-required-mismatch lib/ansible/modules/cloud/atomic/atomic_container.py validate-modules:no-default-for-required-parameter