Add ability to store and access module results later on in the play. See examples/playbooks/register_logic for details.

This commit is contained in:
Michael DeHaan 2012-08-10 01:13:37 -04:00
parent 6c5761a79e
commit 05a128c2be
4 changed files with 35 additions and 4 deletions

View file

@ -23,13 +23,13 @@ class Task(object):
__slots__ = [
'name', 'action', 'only_if', 'async_seconds', 'async_poll_interval',
'notify', 'module_name', 'module_args', 'module_vars',
'play', 'notified_by', 'tags', 'with_items', 'first_available_file', 'ignore_errors'
'play', 'notified_by', 'tags', 'register', 'with_items', 'first_available_file', 'ignore_errors'
]
# to prevent typos and such
VALID_KEYS = [
'name', 'action', 'only_if', 'async', 'poll', 'notify', 'with_items', 'first_available_file',
'include', 'tags', 'ignore_errors'
'include', 'tags', 'register', 'ignore_errors'
]
def __init__(self, play, ds, module_vars=None):
@ -46,6 +46,7 @@ class Task(object):
self.name = ds.get('name', None)
self.action = ds.get('action', '')
self.tags = [ 'all' ]
self.register = ds.get('register', None)
# notified by is used by Playbook code to flag which hosts
# need to run a notifier