From 41a23f093d398f1fde1411f7245939889cf01e39 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Wed, 16 Nov 2022 05:35:56 +0000 Subject: [PATCH] spotinst_aws_elasticgroup: sanity checks (#5553) (#5554) * spotinst_aws_elastigroup: add elements to parameter do_not_update * spotinst_aws_elastigroup: add docs for parameter token * add missing docs * add changelog fragment * Update plugins/modules/spotinst_aws_elastigroup.py Co-authored-by: Felix Fontein Co-authored-by: Felix Fontein (cherry picked from commit 270dc133b3f4b030886d343f65694aa6bcd33457) Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com> --- .../5553-spotinst-aws-elasticgroup-sanity.yml | 2 ++ plugins/modules/spotinst_aws_elastigroup.py | 28 +++++++++++++++++-- tests/sanity/ignore-2.11.txt | 3 -- tests/sanity/ignore-2.12.txt | 3 -- tests/sanity/ignore-2.13.txt | 3 -- tests/sanity/ignore-2.14.txt | 3 -- tests/sanity/ignore-2.15.txt | 3 -- 7 files changed, 28 insertions(+), 17 deletions(-) create mode 100644 changelogs/fragments/5553-spotinst-aws-elasticgroup-sanity.yml diff --git a/changelogs/fragments/5553-spotinst-aws-elasticgroup-sanity.yml b/changelogs/fragments/5553-spotinst-aws-elasticgroup-sanity.yml new file mode 100644 index 0000000000..1213f5412a --- /dev/null +++ b/changelogs/fragments/5553-spotinst-aws-elasticgroup-sanity.yml @@ -0,0 +1,2 @@ +minor_changes: + - spotinst_aws_elastigroup - add ``elements`` attribute when missing in ``list`` parameters (https://github.com/ansible-collections/community.general/pull/5553). diff --git a/plugins/modules/spotinst_aws_elastigroup.py b/plugins/modules/spotinst_aws_elastigroup.py index df2b8d84db..481ba70cb9 100644 --- a/plugins/modules/spotinst_aws_elastigroup.py +++ b/plugins/modules/spotinst_aws_elastigroup.py @@ -35,6 +35,13 @@ options: By default this is retrieved from the credentials path. type: str + token: + description: + - A Personal API Access Token issued by Spotinst. + - >- + When not specified, the module will try to obtain it, in that order, from: environment variable C(SPOTINST_TOKEN), or from the credentials path. + type: str + availability_vs_cost: description: - The strategy orientation. @@ -507,8 +514,25 @@ options: description: - TODO document. type: list + elements: str default: [] + multai_token: + description: + - Token used for Multai configuration. + type: str + + multai_load_balancers: + description: + - Configuration parameters for Multai load balancers. + type: list + elements: dict + + elastic_beanstalk: + description: + - Placeholder parameter for future implementation of Elastic Beanstalk configurations. + type: dict + ''' EXAMPLES = ''' # Basic configuration YAML example @@ -1455,7 +1479,7 @@ def main(): block_device_mappings=dict(type='list', elements='dict'), chef=dict(type='dict'), credentials_path=dict(type='path', default="~/.spotinst/credentials"), - do_not_update=dict(default=[], type='list'), + do_not_update=dict(default=[], type='list', elements='str'), down_scaling_policies=dict(type='list', elements='dict'), draining_timeout=dict(type='int'), ebs_optimized=dict(type='bool'), @@ -1479,7 +1503,7 @@ def main(): mesosphere=dict(type='dict'), min_size=dict(type='int', required=True), monitoring=dict(type='str'), - multai_load_balancers=dict(type='list'), + multai_load_balancers=dict(type='list', elements='dict'), multai_token=dict(type='str', no_log=True), name=dict(type='str', required=True), network_interfaces=dict(type='list', elements='dict'), diff --git a/tests/sanity/ignore-2.11.txt b/tests/sanity/ignore-2.11.txt index 603981df04..848247e944 100644 --- a/tests/sanity/ignore-2.11.txt +++ b/tests/sanity/ignore-2.11.txt @@ -29,9 +29,6 @@ plugins/modules/rax_scaling_group.py use-argspec-type-path # fix needed, expand plugins/modules/redhat_subscription.py validate-modules:return-syntax-error plugins/modules/rhevm.py validate-modules:parameter-state-invalid-choice plugins/modules/scaleway_organization_info.py validate-modules:return-syntax-error -plugins/modules/spotinst_aws_elastigroup.py validate-modules:parameter-list-no-elements -plugins/modules/spotinst_aws_elastigroup.py validate-modules:parameter-type-not-in-doc -plugins/modules/spotinst_aws_elastigroup.py validate-modules:undocumented-parameter plugins/modules/ssh_config.py use-argspec-type-path # Required since module uses other methods to specify path plugins/modules/udm_share.py validate-modules:parameter-list-no-elements plugins/modules/udm_user.py validate-modules:parameter-list-no-elements diff --git a/tests/sanity/ignore-2.12.txt b/tests/sanity/ignore-2.12.txt index 778f25ae53..9f277b5367 100644 --- a/tests/sanity/ignore-2.12.txt +++ b/tests/sanity/ignore-2.12.txt @@ -24,9 +24,6 @@ plugins/modules/rax_scaling_group.py use-argspec-type-path # fix needed, expand plugins/modules/redhat_subscription.py validate-modules:return-syntax-error plugins/modules/rhevm.py validate-modules:parameter-state-invalid-choice plugins/modules/scaleway_organization_info.py validate-modules:return-syntax-error -plugins/modules/spotinst_aws_elastigroup.py validate-modules:parameter-list-no-elements -plugins/modules/spotinst_aws_elastigroup.py validate-modules:parameter-type-not-in-doc -plugins/modules/spotinst_aws_elastigroup.py validate-modules:undocumented-parameter plugins/modules/ssh_config.py use-argspec-type-path # Required since module uses other methods to specify path plugins/modules/udm_share.py validate-modules:parameter-list-no-elements plugins/modules/udm_user.py validate-modules:parameter-list-no-elements diff --git a/tests/sanity/ignore-2.13.txt b/tests/sanity/ignore-2.13.txt index 778f25ae53..9f277b5367 100644 --- a/tests/sanity/ignore-2.13.txt +++ b/tests/sanity/ignore-2.13.txt @@ -24,9 +24,6 @@ plugins/modules/rax_scaling_group.py use-argspec-type-path # fix needed, expand plugins/modules/redhat_subscription.py validate-modules:return-syntax-error plugins/modules/rhevm.py validate-modules:parameter-state-invalid-choice plugins/modules/scaleway_organization_info.py validate-modules:return-syntax-error -plugins/modules/spotinst_aws_elastigroup.py validate-modules:parameter-list-no-elements -plugins/modules/spotinst_aws_elastigroup.py validate-modules:parameter-type-not-in-doc -plugins/modules/spotinst_aws_elastigroup.py validate-modules:undocumented-parameter plugins/modules/ssh_config.py use-argspec-type-path # Required since module uses other methods to specify path plugins/modules/udm_share.py validate-modules:parameter-list-no-elements plugins/modules/udm_user.py validate-modules:parameter-list-no-elements diff --git a/tests/sanity/ignore-2.14.txt b/tests/sanity/ignore-2.14.txt index 20f87d1af2..dd73e39327 100644 --- a/tests/sanity/ignore-2.14.txt +++ b/tests/sanity/ignore-2.14.txt @@ -25,9 +25,6 @@ plugins/modules/rax_scaling_group.py use-argspec-type-path # fix needed, expand plugins/modules/redhat_subscription.py validate-modules:return-syntax-error plugins/modules/rhevm.py validate-modules:parameter-state-invalid-choice plugins/modules/scaleway_organization_info.py validate-modules:return-syntax-error -plugins/modules/spotinst_aws_elastigroup.py validate-modules:parameter-list-no-elements -plugins/modules/spotinst_aws_elastigroup.py validate-modules:parameter-type-not-in-doc -plugins/modules/spotinst_aws_elastigroup.py validate-modules:undocumented-parameter plugins/modules/ssh_config.py use-argspec-type-path # Required since module uses other methods to specify path plugins/modules/udm_share.py validate-modules:parameter-list-no-elements plugins/modules/udm_user.py import-3.11 # Uses deprecated stdlib library 'crypt' diff --git a/tests/sanity/ignore-2.15.txt b/tests/sanity/ignore-2.15.txt index 20f87d1af2..dd73e39327 100644 --- a/tests/sanity/ignore-2.15.txt +++ b/tests/sanity/ignore-2.15.txt @@ -25,9 +25,6 @@ plugins/modules/rax_scaling_group.py use-argspec-type-path # fix needed, expand plugins/modules/redhat_subscription.py validate-modules:return-syntax-error plugins/modules/rhevm.py validate-modules:parameter-state-invalid-choice plugins/modules/scaleway_organization_info.py validate-modules:return-syntax-error -plugins/modules/spotinst_aws_elastigroup.py validate-modules:parameter-list-no-elements -plugins/modules/spotinst_aws_elastigroup.py validate-modules:parameter-type-not-in-doc -plugins/modules/spotinst_aws_elastigroup.py validate-modules:undocumented-parameter plugins/modules/ssh_config.py use-argspec-type-path # Required since module uses other methods to specify path plugins/modules/udm_share.py validate-modules:parameter-list-no-elements plugins/modules/udm_user.py import-3.11 # Uses deprecated stdlib library 'crypt'