From c84e11e9d535c818b19d438bb94c08c3265116e9 Mon Sep 17 00:00:00 2001 From: Daniel Hokka Zakrisson Date: Tue, 19 Jun 2012 21:58:24 +0200 Subject: [PATCH] Default to using a ControlMaster connection --- lib/ansible/runner/connection/ssh.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/ansible/runner/connection/ssh.py b/lib/ansible/runner/connection/ssh.py index 0a72dcb9564..54644aa0f2b 100644 --- a/lib/ansible/runner/connection/ssh.py +++ b/lib/ansible/runner/connection/ssh.py @@ -48,6 +48,10 @@ class SSHConnection(object): extra_args = os.getenv("ANSIBLE_SSH_ARGS", None) if extra_args is not None: self.common_args += shlex.split(extra_args) + else: + self.common_args += ["-o", "ControlMaster=auto", + "-o", "ControlPersist=60s", + "-o", "ControlPath=/tmp/ansible-ssh-%h-%p-%r"] self.userhost = "%s@%s" % (self.runner.remote_user, self.host) return self