mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-08 01:14:03 -07:00
Add config to fail on invalid task attributes. Fixes #42479
This commit is contained in:
parent
937e710485
commit
8aea8901c3
2 changed files with 12 additions and 1 deletions
|
@ -1375,6 +1375,17 @@ HOST_KEY_CHECKING:
|
||||||
ini:
|
ini:
|
||||||
- {key: host_key_checking, section: defaults}
|
- {key: host_key_checking, section: defaults}
|
||||||
type: boolean
|
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
|
||||||
|
type: boolean
|
||||||
|
env:
|
||||||
|
- name: ANSIBLE_INVALID_TASK_ATTRIBUTE_FAILED
|
||||||
|
ini:
|
||||||
|
- key: invalid_task_attribute_failed
|
||||||
|
section: defaults
|
||||||
|
version_added: "2.7"
|
||||||
INVENTORY_ANY_UNPARSED_IS_FAILED:
|
INVENTORY_ANY_UNPARSED_IS_FAILED:
|
||||||
name: Controls whether any unparseable inventory source is a fatal error
|
name: Controls whether any unparseable inventory source is a fatal error
|
||||||
default: False
|
default: False
|
||||||
|
|
|
@ -231,7 +231,7 @@ class Task(Base, Conditional, Taggable, Become):
|
||||||
" Please see:\nhttps://docs.ansible.com/ansible/playbooks_roles.html#task-include-files-and-encouraging-reuse\n\n"
|
" Please see:\nhttps://docs.ansible.com/ansible/playbooks_roles.html#task-include-files-and-encouraging-reuse\n\n"
|
||||||
" for currently supported syntax regarding included files and variables", version="2.7")
|
" for currently supported syntax regarding included files and variables", version="2.7")
|
||||||
new_ds['vars'][k] = v
|
new_ds['vars'][k] = v
|
||||||
elif k in self._valid_attrs:
|
elif C.INVALID_TASK_ATTRIBUTE_FAILED or k in self._valid_attrs:
|
||||||
new_ds[k] = v
|
new_ds[k] = v
|
||||||
else:
|
else:
|
||||||
display.warning("Ignoring invalid attribute: %s" % k)
|
display.warning("Ignoring invalid attribute: %s" % k)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue