Skip to content

Instantly share code, notes, and snippets.

@tgerla
Created November 8, 2013 04:32
Show Gist options
  • Select an option

  • Save tgerla/7366298 to your computer and use it in GitHub Desktop.

Select an option

Save tgerla/7366298 to your computer and use it in GitHub Desktop.
diff --git a/lib/ansible/runner/__init__.py b/lib/ansible/runner/__init__.py
index 1755879..d305a38 100644
--- a/lib/ansible/runner/__init__.py
+++ b/lib/ansible/runner/__init__.py
@@ -411,6 +411,7 @@ class Runner(object):
inject = utils.combine_vars(inject, self.module_vars)
inject = utils.combine_vars(inject, self.setup_cache[host])
inject.setdefault('ansible_ssh_user', self.remote_user)
+ inject.setdefault('ansible_connection', host_connection)
inject['hostvars'] = HostVars(self.setup_cache, self.inventory)
inject['group_names'] = host_variables.get('group_names', [])
inject['groups'] = self.inventory.groups_list()
@joemaller
Copy link

This would be really helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment