Able to use "environment: " on any task to pass proxy details and other useful settings. Can be a variable

or a dictionary.
This commit is contained in:
Michael DeHaan 2013-02-10 13:05:58 -05:00
parent 72a05ae2a0
commit f7497e75e5
4 changed files with 27 additions and 5 deletions

View file

@ -27,7 +27,7 @@ class Task(object):
'play', 'notified_by', 'tags', 'register',
'delegate_to', 'first_available_file', 'ignore_errors',
'local_action', 'transport', 'sudo', 'sudo_user', 'sudo_pass',
'items_lookup_plugin', 'items_lookup_terms'
'items_lookup_plugin', 'items_lookup_terms', 'environment'
]
# to prevent typos and such
@ -35,7 +35,7 @@ class Task(object):
'name', 'action', 'only_if', 'async', 'poll', 'notify',
'first_available_file', 'include', 'tags', 'register', 'ignore_errors',
'delegate_to', 'local_action', 'transport', 'sudo', 'sudo_user',
'sudo_pass', 'when', 'connection'
'sudo_pass', 'when', 'connection', 'environment'
]
def __init__(self, play, ds, module_vars=None, additional_conditions=None):
@ -80,6 +80,7 @@ class Task(object):
self.tags = [ 'all' ]
self.register = ds.get('register', None)
self.sudo = utils.boolean(ds.get('sudo', play.sudo))
self.environment = ds.get('environment', {})
if self.sudo:
self.sudo_user = ds.get('sudo_user', play.sudo_user)