Swap default for INVALID_TASK_ATTRIBUTE_FAILED to True, add additional info to exception (#44138)

pull/44153/merge
Matt Martz 6 years ago committed by GitHub
parent 0beaea22a4
commit 509e92ef72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1385,8 +1385,8 @@ HOST_KEY_CHECKING:
type: boolean
INVALID_TASK_ATTRIBUTE_FAILED:
name: Controls whether invalid attributes for a task result in errors instead of warnings
default: false
description: If 'true', invalid attributes for a task will result in errors instead of warnings
default: True
description: If 'false', invalid attributes for a task will result in warnings instead of errors
type: boolean
env:
- name: ANSIBLE_INVALID_TASK_ATTRIBUTE_FAILED

@ -248,6 +248,13 @@ class Task(Base, Conditional, Taggable, Become):
return LoopControl.load(data=ds, variable_manager=self._variable_manager, loader=self._loader)
def _validate_attributes(self, ds):
try:
super(Task, self)._validate_attributes(ds)
except AnsibleParserError as e:
e.message += '\nThis error can be suppressed as a warning using the "invalid_task_attribute_failed" configuration'
raise e
def post_validate(self, templar):
'''
Override of base class post_validate, to also do final validation on

Loading…
Cancel
Save