1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Add name field for Blocks

Fixes #18420
This commit is contained in:
James Cammarata 2016-11-15 11:57:57 -06:00
parent 57cf5e431c
commit fcb033b9e4
2 changed files with 10 additions and 5 deletions

View file

@ -11,6 +11,7 @@ Ansible Changes By Release
the release.
* removed 'package' from default squash actions as not all package managers support it and it creates errors when using loops,
any user can add back via config options if they don't use those package managers or othewise avoid the errors.
* Blocks can now have a `name` field, to aid in playbook readability.
###Deprecations:
* Specifying --tags (or --skip-tags) multiple times on the command line

View file

@ -30,12 +30,16 @@ from ansible.playbook.taggable import Taggable
class Block(Base, Become, Conditional, Taggable):
_block = FieldAttribute(isa='list', default=[], inherit=False)
_rescue = FieldAttribute(isa='list', default=[], inherit=False)
_always = FieldAttribute(isa='list', default=[], inherit=False)
_delegate_to = FieldAttribute(isa='list')
_delegate_facts = FieldAttribute(isa='bool', default=False)
# main block fields containing the task lists
_block = FieldAttribute(isa='list', default=[], inherit=False)
_rescue = FieldAttribute(isa='list', default=[], inherit=False)
_always = FieldAttribute(isa='list', default=[], inherit=False)
# other fields
_any_errors_fatal = FieldAttribute(isa='bool')
_delegate_to = FieldAttribute(isa='list')
_delegate_facts = FieldAttribute(isa='bool', default=False)
_name = FieldAttribute(isa='string', default='')
# for future consideration? this would be functionally
# similar to the 'else' clause for exceptions