Commit 07101085 by Michael DeHaan

Merge pull request #1093 from brainpage/make_local_action_consistant

2 improvements to delegate_to
parents 51216dcf faed650b
...@@ -61,12 +61,18 @@ class Task(object): ...@@ -61,12 +61,18 @@ class Task(object):
elif 'local_action' in ds: elif 'local_action' in ds:
self.action = ds.get('local_action', '') self.action = ds.get('local_action', '')
self.delegate_to = '127.0.0.1' self.delegate_to = '127.0.0.1'
self.transport = 'local'
else: else:
self.action = ds.get('action', '') self.action = ds.get('action', '')
self.delegate_to = ds.get('delegate_to', None) self.delegate_to = ds.get('delegate_to', None)
self.transport = ds.get('transport', play.transport) self.transport = ds.get('transport', play.transport)
# delegate_to can use variables
if not (self.delegate_to is None):
self.delegate_to = utils.template(None, self.delegate_to, self.module_vars)
# delegate_to: localhost should use local transport
if self.delegate_to in ['127.0.0.1', 'localhost']:
self.transport = 'local'
# notified by is used by Playbook code to flag which hosts # notified by is used by Playbook code to flag which hosts
# need to run a notifier # need to run a notifier
self.notified_by = [] self.notified_by = []
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment