mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-09 17:59:09 -07:00
parent
c2e02fbd6b
commit
a5ee6ff1e5
2 changed files with 15 additions and 7 deletions
|
@ -41,7 +41,7 @@ class Task(object):
|
|||
'any_errors_fatal', 'changed_when', 'failed_when', 'always_run'
|
||||
]
|
||||
|
||||
def __init__(self, play, ds, module_vars=None, default_vars=None, additional_conditions=None):
|
||||
def __init__(self, play, ds, module_vars=None, default_vars=None, additional_conditions=None, role_name=None):
|
||||
''' constructor loads from a task or handler datastructure '''
|
||||
|
||||
# meta directives are used to tell things like ansible/playbook to run
|
||||
|
@ -159,6 +159,10 @@ class Task(object):
|
|||
if self.name is None:
|
||||
self.name = self.action
|
||||
|
||||
# prepend the role name this task is from, if there was one
|
||||
if role_name:
|
||||
self.name = "%s|%s" % (role_name, self.name)
|
||||
|
||||
# load various attributes
|
||||
self.only_if = ds.get('only_if', 'True')
|
||||
self.when = ds.get('when', None)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue