diff --git a/changelogs/fragments/1761-redfish-tidy-up-validation.yml b/changelogs/fragments/1761-redfish-tidy-up-validation.yml new file mode 100644 index 0000000000..751c7ca30d --- /dev/null +++ b/changelogs/fragments/1761-redfish-tidy-up-validation.yml @@ -0,0 +1,2 @@ +minor_changes: + - redfish modules - explicitly setting lists' elements to ``str`` (https://github.com/ansible-collections/community.general/pull/1761). diff --git a/plugins/modules/remote_management/redfish/idrac_redfish_command.py b/plugins/modules/remote_management/redfish/idrac_redfish_command.py index ea97ecdcd5..fb32248271 100644 --- a/plugins/modules/remote_management/redfish/idrac_redfish_command.py +++ b/plugins/modules/remote_management/redfish/idrac_redfish_command.py @@ -26,6 +26,7 @@ options: description: - List of commands to execute on OOB controller type: list + elements: str baseuri: required: true description: @@ -134,7 +135,7 @@ def main(): module = AnsibleModule( argument_spec=dict( category=dict(required=True), - command=dict(required=True, type='list'), + command=dict(required=True, type='list', elements='str'), baseuri=dict(required=True), username=dict(required=True), password=dict(required=True, no_log=True), diff --git a/plugins/modules/remote_management/redfish/idrac_redfish_config.py b/plugins/modules/remote_management/redfish/idrac_redfish_config.py index 485d54cd78..9248da2030 100644 --- a/plugins/modules/remote_management/redfish/idrac_redfish_config.py +++ b/plugins/modules/remote_management/redfish/idrac_redfish_config.py @@ -29,6 +29,7 @@ options: I(SetSystemAttributes) are mutually exclusive commands when C(category) is I(Manager) type: list + elements: str baseuri: required: true description: @@ -245,7 +246,7 @@ def main(): module = AnsibleModule( argument_spec=dict( category=dict(required=True), - command=dict(required=True, type='list'), + command=dict(required=True, type='list', elements='str'), baseuri=dict(required=True), username=dict(required=True), password=dict(required=True, no_log=True), diff --git a/plugins/modules/remote_management/redfish/idrac_redfish_info.py b/plugins/modules/remote_management/redfish/idrac_redfish_info.py index f5b7fe1af9..9044aa56bf 100644 --- a/plugins/modules/remote_management/redfish/idrac_redfish_info.py +++ b/plugins/modules/remote_management/redfish/idrac_redfish_info.py @@ -30,6 +30,7 @@ options: - C(GetManagerAttributes) returns the list of dicts containing iDRAC, LifecycleController and System attributes type: list + elements: str baseuri: required: true description: @@ -171,7 +172,7 @@ def main(): module = AnsibleModule( argument_spec=dict( category=dict(required=True), - command=dict(required=True, type='list'), + command=dict(required=True, type='list', elements='str'), baseuri=dict(required=True), username=dict(required=True), password=dict(required=True, no_log=True), diff --git a/plugins/modules/remote_management/redfish/redfish_command.py b/plugins/modules/remote_management/redfish/redfish_command.py index 78007f1de9..d409c0e023 100644 --- a/plugins/modules/remote_management/redfish/redfish_command.py +++ b/plugins/modules/remote_management/redfish/redfish_command.py @@ -28,6 +28,7 @@ options: description: - List of commands to execute on OOB controller type: list + elements: str baseuri: required: true description: @@ -550,7 +551,7 @@ def main(): module = AnsibleModule( argument_spec=dict( category=dict(required=True), - command=dict(required=True, type='list'), + command=dict(required=True, type='list', elements='str'), baseuri=dict(required=True), username=dict(required=True), password=dict(required=True, no_log=True), diff --git a/plugins/modules/remote_management/redfish/redfish_config.py b/plugins/modules/remote_management/redfish/redfish_config.py index 26b692a6f3..60612da35f 100644 --- a/plugins/modules/remote_management/redfish/redfish_config.py +++ b/plugins/modules/remote_management/redfish/redfish_config.py @@ -27,6 +27,7 @@ options: description: - List of commands to execute on OOB controller type: list + elements: str baseuri: required: true description: @@ -228,7 +229,7 @@ def main(): module = AnsibleModule( argument_spec=dict( category=dict(required=True), - command=dict(required=True, type='list'), + command=dict(required=True, type='list', elements='str'), baseuri=dict(required=True), username=dict(required=True), password=dict(required=True, no_log=True), diff --git a/plugins/modules/remote_management/redfish/redfish_info.py b/plugins/modules/remote_management/redfish/redfish_info.py index cfdb1aef5b..7bf209b7f6 100644 --- a/plugins/modules/remote_management/redfish/redfish_info.py +++ b/plugins/modules/remote_management/redfish/redfish_info.py @@ -24,11 +24,13 @@ options: - List of categories to execute on OOB controller default: ['Systems'] type: list + elements: str command: required: false description: - List of commands to execute on OOB controller type: list + elements: str baseuri: required: true description: @@ -296,8 +298,8 @@ def main(): category_list = [] module = AnsibleModule( argument_spec=dict( - category=dict(type='list', default=['Systems']), - command=dict(type='list'), + category=dict(type='list', elements='str', default=['Systems']), + command=dict(type='list', elements='str'), baseuri=dict(required=True), username=dict(required=True), password=dict(required=True, no_log=True), diff --git a/tests/sanity/ignore-2.10.txt b/tests/sanity/ignore-2.10.txt index cee8ab22ca..6297878d97 100644 --- a/tests/sanity/ignore-2.10.txt +++ b/tests/sanity/ignore-2.10.txt @@ -290,12 +290,6 @@ plugins/modules/remote_management/oneview/oneview_san_manager.py validate-module plugins/modules/remote_management/oneview/oneview_san_manager.py validate-modules:undocumented-parameter plugins/modules/remote_management/oneview/oneview_san_manager_info.py validate-modules:parameter-type-not-in-doc plugins/modules/remote_management/oneview/oneview_san_manager_info.py validate-modules:undocumented-parameter -plugins/modules/remote_management/redfish/idrac_redfish_command.py validate-modules:parameter-list-no-elements -plugins/modules/remote_management/redfish/idrac_redfish_config.py validate-modules:parameter-list-no-elements -plugins/modules/remote_management/redfish/idrac_redfish_info.py validate-modules:parameter-list-no-elements -plugins/modules/remote_management/redfish/redfish_command.py validate-modules:parameter-list-no-elements -plugins/modules/remote_management/redfish/redfish_config.py validate-modules:parameter-list-no-elements -plugins/modules/remote_management/redfish/redfish_info.py validate-modules:parameter-list-no-elements plugins/modules/remote_management/stacki/stacki_host.py validate-modules:doc-default-does-not-match-spec plugins/modules/remote_management/stacki/stacki_host.py validate-modules:no-default-for-required-parameter plugins/modules/remote_management/stacki/stacki_host.py validate-modules:parameter-type-not-in-doc diff --git a/tests/sanity/ignore-2.11.txt b/tests/sanity/ignore-2.11.txt index 0ee04a42c9..495ce2de09 100644 --- a/tests/sanity/ignore-2.11.txt +++ b/tests/sanity/ignore-2.11.txt @@ -289,12 +289,6 @@ plugins/modules/remote_management/oneview/oneview_san_manager.py validate-module plugins/modules/remote_management/oneview/oneview_san_manager.py validate-modules:undocumented-parameter plugins/modules/remote_management/oneview/oneview_san_manager_info.py validate-modules:parameter-type-not-in-doc plugins/modules/remote_management/oneview/oneview_san_manager_info.py validate-modules:undocumented-parameter -plugins/modules/remote_management/redfish/idrac_redfish_command.py validate-modules:parameter-list-no-elements -plugins/modules/remote_management/redfish/idrac_redfish_config.py validate-modules:parameter-list-no-elements -plugins/modules/remote_management/redfish/idrac_redfish_info.py validate-modules:parameter-list-no-elements -plugins/modules/remote_management/redfish/redfish_command.py validate-modules:parameter-list-no-elements -plugins/modules/remote_management/redfish/redfish_config.py validate-modules:parameter-list-no-elements -plugins/modules/remote_management/redfish/redfish_info.py validate-modules:parameter-list-no-elements plugins/modules/remote_management/stacki/stacki_host.py validate-modules:doc-default-does-not-match-spec plugins/modules/remote_management/stacki/stacki_host.py validate-modules:no-default-for-required-parameter plugins/modules/remote_management/stacki/stacki_host.py validate-modules:parameter-type-not-in-doc