|
|
|
@ -131,6 +131,7 @@ class Runner(object):
|
|
|
|
|
sudo=False, # whether to run sudo or not
|
|
|
|
|
sudo_user=C.DEFAULT_SUDO_USER, # ex: 'root'
|
|
|
|
|
module_vars=None, # a playbooks internals thing
|
|
|
|
|
default_vars=None, # ditto
|
|
|
|
|
is_playbook=False, # running from playbook or not?
|
|
|
|
|
inventory=None, # reference to Inventory object
|
|
|
|
|
subset=None, # subset pattern
|
|
|
|
@ -159,6 +160,7 @@ class Runner(object):
|
|
|
|
|
self.inventory = utils.default(inventory, lambda: ansible.inventory.Inventory(host_list))
|
|
|
|
|
|
|
|
|
|
self.module_vars = utils.default(module_vars, lambda: {})
|
|
|
|
|
self.default_vars = utils.default(default_vars, lambda: {})
|
|
|
|
|
self.always_run = None
|
|
|
|
|
self.connector = connection.Connection(self)
|
|
|
|
|
self.conditional = conditional
|
|
|
|
@ -405,6 +407,7 @@ class Runner(object):
|
|
|
|
|
port = self.remote_port
|
|
|
|
|
|
|
|
|
|
inject = {}
|
|
|
|
|
inject = utils.combine_vars(inject, self.default_vars)
|
|
|
|
|
inject = utils.combine_vars(inject, host_variables)
|
|
|
|
|
inject = utils.combine_vars(inject, self.module_vars)
|
|
|
|
|
inject = utils.combine_vars(inject, self.setup_cache[host])
|
|
|
|
@ -413,6 +416,7 @@ class Runner(object):
|
|
|
|
|
inject['group_names'] = host_variables.get('group_names', [])
|
|
|
|
|
inject['groups'] = self.inventory.groups_list()
|
|
|
|
|
inject['vars'] = self.module_vars
|
|
|
|
|
inject['defaults'] = self.default_vars
|
|
|
|
|
inject['environment'] = self.environment
|
|
|
|
|
|
|
|
|
|
if self.inventory.basedir() is not None:
|
|
|
|
|