mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-20 15:20:21 -07:00
remove default from delegate_facts to inherit (#45492)
* remove default from delegate_facts to inherit fixes #45456 * test delegate_facts * added note about inheritance and defaults * yamllint
This commit is contained in:
parent
58aaf53271
commit
8743e6ae2e
5 changed files with 34 additions and 3 deletions
|
@ -38,7 +38,7 @@ class Block(Base, Become, Conditional, Taggable):
|
|||
|
||||
# other fields
|
||||
_delegate_to = FieldAttribute(isa='string')
|
||||
_delegate_facts = FieldAttribute(isa='bool', default=False)
|
||||
_delegate_facts = FieldAttribute(isa='bool')
|
||||
|
||||
# for future consideration? this would be functionally
|
||||
# similar to the 'else' clause for exceptions
|
||||
|
|
|
@ -94,7 +94,7 @@ def hash_params(params):
|
|||
class Role(Base, Become, Conditional, Taggable):
|
||||
|
||||
_delegate_to = FieldAttribute(isa='string')
|
||||
_delegate_facts = FieldAttribute(isa='bool', default=False)
|
||||
_delegate_facts = FieldAttribute(isa='bool')
|
||||
|
||||
def __init__(self, play=None, from_files=None, from_include=False):
|
||||
self._role_name = None
|
||||
|
|
|
@ -66,6 +66,10 @@ class Task(Base, Conditional, Taggable, Become):
|
|||
# will be used if defined
|
||||
# might be possible to define others
|
||||
|
||||
# NOTE: ONLY set defaults on task attributes that are not inheritable,
|
||||
# inheritance is only triggered if the 'current value' is None,
|
||||
# default can be set at play/top level object and inheritance will take it's course.
|
||||
|
||||
_args = FieldAttribute(isa='dict', default=dict())
|
||||
_action = FieldAttribute(isa='string')
|
||||
|
||||
|
@ -73,7 +77,7 @@ class Task(Base, Conditional, Taggable, Become):
|
|||
_changed_when = FieldAttribute(isa='list', default=[])
|
||||
_delay = FieldAttribute(isa='int', default=5)
|
||||
_delegate_to = FieldAttribute(isa='string')
|
||||
_delegate_facts = FieldAttribute(isa='bool', default=False)
|
||||
_delegate_facts = FieldAttribute(isa='bool')
|
||||
_failed_when = FieldAttribute(isa='list', default=[])
|
||||
_loop = FieldAttribute()
|
||||
_loop_control = FieldAttribute(isa='class', class_type=LoopControl, inherit=False)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue