You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ecs_task attempts to validate parameters using an and statement.
For example:
if'task_definition'notinmodule.paramsandmodule.params['task_definition'] isNone:
module.fail_json(msg="To stop a task, a task definition must be specified")
This will not evaluate to true even if task_definition not provided because module.params['task_definiton'] = None by default. Which means the condition 'task_definition' not in module.params is always false.
Error indicatin that the task_definition parameter is missing.
ACTUAL RESULTS
The full traceback is:
Traceback (most recent call last):
File "/home/mjmayer/.ansible/tmp/ansible-tmp-1612908699.9970727-2470578-69922562765386/AnsiballZ_ecs_task.py", line 249, in <module>
_ansiballz_main()
File "/home/mjmayer/.ansible/tmp/ansible-tmp-1612908699.9970727-2470578-69922562765386/AnsiballZ_ecs_task.py", line 239, in _ansiballz_main
invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
File "/home/mjmayer/.ansible/tmp/ansible-tmp-1612908699.9970727-2470578-69922562765386/AnsiballZ_ecs_task.py", line 110, in invoke_module
runpy.run_module(mod_name='ansible_collections.community.aws.plugins.modules.ecs_task', init_globals=None, run_name='__main__', alter_sys=True)
File "/usr/lib/python3.8/runpy.py", line 207, in run_module
return _run_module_code(code, init_globals, run_name, mod_spec)
File "/usr/lib/python3.8/runpy.py", line 97, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/tmp/ansible_ecs_task_payload_1abc2nbk/ansible_ecs_task_payload.zip/ansible_collections/community/aws/plugins/modules/ecs_task.py", line 443, in <module>
File "/tmp/ansible_ecs_task_payload_1abc2nbk/ansible_ecs_task_payload.zip/ansible_collections/community/aws/plugins/modules/ecs_task.py", line 390, in main
File "/tmp/ansible_ecs_task_payload_1abc2nbk/ansible_ecs_task_payload.zip/ansible_collections/community/aws/plugins/modules/ecs_task.py", line 251, in list_tasks
File "/home/mjmayer/.local/lib/python3.8/site-packages/botocore/client.py", line 357, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/home/mjmayer/.local/lib/python3.8/site-packages/botocore/client.py", line 648, in _make_api_call
request_dict = self._convert_to_request_dict(
File "/home/mjmayer/.local/lib/python3.8/site-packages/botocore/client.py", line 696, in _convert_to_request_dict
request_dict = self._serializer.serialize_to_request(
File "/home/mjmayer/.local/lib/python3.8/site-packages/botocore/validate.py", line 297, in serialize_to_request
raise ParamValidationError(report=report.generate_report())
botocore.exceptions.ParamValidationError: Parameter validation failed:
Invalid type for parameter family, value: None, type: <class 'NoneType'>, valid types: <class 'str'>
failed: [localhost] (item=arn:aws:ecs:us-west-2:989838493125:task/ait-ecs_cluster-np/b7fa41f566ed47a895035b9536bc88a7) => {
"ansible_loop_var": "item",
"changed": false,
"item": "arn:aws:ecs:us-west-2:989838493125:task/ait-ecs_cluster-np/b7fa41f566ed47a895035b9536bc88a7",
"module_stderr": "Traceback (most recent call last):\n File \"/home/mjmayer/.ansible/tmp/ansible-tmp-1612908699.9970727-2470578-69922562765386/AnsiballZ_ecs_task.py\", line 249, in <module>\n _ansiballz_main()\n File \"/home/mjmayer/.ansible/tmp/ansible-tmp-1612908699.9970727-2470578-69922562765386/AnsiballZ_ecs_task.py\", line 239, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/home/mjmayer/.ansible/tmp/ansible-tmp-1612908699.9970727-2470578-69922562765386/AnsiballZ_ecs_task.py\", line 110, in invoke_module\n runpy.run_module(mod_name='ansible_collections.community.aws.plugins.modules.ecs_task', init_globals=None, run_name='__main__', alter_sys=True)\n File \"/usr/lib/python3.8/runpy.py\", line 207, in run_module\n return _run_module_code(code, init_globals, run_name, mod_spec)\n File \"/usr/lib/python3.8/runpy.py\", line 97, in _run_module_code\n _run_code(code, mod_globals, init_globals,\n File \"/usr/lib/python3.8/runpy.py\", line 87, in _run_code\n exec(code, run_globals)\n File \"/tmp/ansible_ecs_task_payload_1abc2nbk/ansible_ecs_task_payload.zip/ansible_collections/community/aws/plugins/modules/ecs_task.py\", line 443, in <module>\n File \"/tmp/ansible_ecs_task_payload_1abc2nbk/ansible_ecs_task_payload.zip/ansible_collections/community/aws/plugins/modules/ecs_task.py\", line 390, in main\n File \"/tmp/ansible_ecs_task_payload_1abc2nbk/ansible_ecs_task_payload.zip/ansible_collections/community/aws/plugins/modules/ecs_task.py\", line 251, in list_tasks\n File \"/home/mjmayer/.local/lib/python3.8/site-packages/botocore/client.py\", line 357, in _api_call\n return self._make_api_call(operation_name, kwargs)\n File \"/home/mjmayer/.local/lib/python3.8/site-packages/botocore/client.py\", line 648, in _make_api_call\n request_dict = self._convert_to_request_dict(\n File \"/home/mjmayer/.local/lib/python3.8/site-packages/botocore/client.py\", line 696, in _convert_to_request_dict\n request_dict = self._serializer.serialize_to_request(\n File \"/home/mjmayer/.local/lib/python3.8/site-packages/botocore/validate.py\", line 297, in serialize_to_request\n raise ParamValidationError(report=report.generate_report())\nbotocore.exceptions.ParamValidationError: Parameter validation failed:\nInvalid type for parameter family, value: None, type: <class 'NoneType'>, valid types: <class 'str'>\n",
"module_stdout": "",
"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
"rc": 1
}
The text was updated successfully, but these errors were encountered:
Add template for a CI issue
SUMMARY
As suggested by @goneri
ISSUE TYPE
Feature Pull Request
COMPONENT NAME
.github/
ADDITIONAL INFORMATION
Reviewed-by: Alina Buzachis <None>
Reviewed-by: Gonéri Le Bouder <[email protected]>
SUMMARY
ecs_task attempts to validate parameters using an
and
statement.For example:
This will not evaluate to true even if
task_definition
not provided becausemodule.params['task_definiton'] = None
by default. Which means the condition'task_definition' not in module.params
is always false.ISSUE TYPE
COMPONENT NAME
ecs_task
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
N/A
STEPS TO REPRODUCE
EXPECTED RESULTS
Error indicatin that the
task_definition
parameter is missing.ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: