|
|
@ -29,7 +29,7 @@ class Task(object):
|
|
|
|
'delegate_to', 'first_available_file', 'ignore_errors',
|
|
|
|
'delegate_to', 'first_available_file', 'ignore_errors',
|
|
|
|
'local_action', 'transport', 'sudo', 'sudo_user', 'sudo_pass',
|
|
|
|
'local_action', 'transport', 'sudo', 'sudo_user', 'sudo_pass',
|
|
|
|
'items_lookup_plugin', 'items_lookup_terms', 'environment', 'args',
|
|
|
|
'items_lookup_plugin', 'items_lookup_terms', 'environment', 'args',
|
|
|
|
'any_errors_fatal', 'changed_when', 'failed_when', 'always_run'
|
|
|
|
'any_errors_fatal', 'changed_when', 'failed_when', 'always_run', 'delay', 'retries', 'until'
|
|
|
|
]
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
# to prevent typos and such
|
|
|
|
# to prevent typos and such
|
|
|
@ -38,7 +38,7 @@ class Task(object):
|
|
|
|
'first_available_file', 'include', 'tags', 'register', 'ignore_errors',
|
|
|
|
'first_available_file', 'include', 'tags', 'register', 'ignore_errors',
|
|
|
|
'delegate_to', 'local_action', 'transport', 'sudo', 'sudo_user',
|
|
|
|
'delegate_to', 'local_action', 'transport', 'sudo', 'sudo_user',
|
|
|
|
'sudo_pass', 'when', 'connection', 'environment', 'args',
|
|
|
|
'sudo_pass', 'when', 'connection', 'environment', 'args',
|
|
|
|
'any_errors_fatal', 'changed_when', 'failed_when', 'always_run'
|
|
|
|
'any_errors_fatal', 'changed_when', 'failed_when', 'always_run', 'delay', 'retries', 'until'
|
|
|
|
]
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
def __init__(self, play, ds, module_vars=None, default_vars=None, additional_conditions=None, role_name=None):
|
|
|
|
def __init__(self, play, ds, module_vars=None, default_vars=None, additional_conditions=None, role_name=None):
|
|
|
@ -112,6 +112,16 @@ class Task(object):
|
|
|
|
self.environment = ds.get('environment', {})
|
|
|
|
self.environment = ds.get('environment', {})
|
|
|
|
self.role_name = role_name
|
|
|
|
self.role_name = role_name
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#Code to allow do until feature in a Task
|
|
|
|
|
|
|
|
if 'until' in ds:
|
|
|
|
|
|
|
|
if not ds.get('register'):
|
|
|
|
|
|
|
|
raise errors.AnsibleError("register keyword is mandatory when using do until feature")
|
|
|
|
|
|
|
|
self.module_vars['delay'] = ds.get('delay', 5)
|
|
|
|
|
|
|
|
self.module_vars['retries'] = ds.get('retries', 3)
|
|
|
|
|
|
|
|
self.module_vars['register'] = ds.get('register', None)
|
|
|
|
|
|
|
|
self.until = "jinja2_compare %s" % (ds.get('until'))
|
|
|
|
|
|
|
|
self.module_vars['until'] = utils.compile_when_to_only_if(self.until)
|
|
|
|
|
|
|
|
|
|
|
|
# rather than simple key=value args on the options line, these represent structured data and the values
|
|
|
|
# rather than simple key=value args on the options line, these represent structured data and the values
|
|
|
|
# can be hashes and lists, not just scalars
|
|
|
|
# can be hashes and lists, not just scalars
|
|
|
|
self.args = ds.get('args', {})
|
|
|
|
self.args = ds.get('args', {})
|
|
|
|