diff --git a/lib/ansible/plugins/connection/__init__.py b/lib/ansible/plugins/connection/__init__.py index e9fff76ace..6bc1994b81 100644 --- a/lib/ansible/plugins/connection/__init__.py +++ b/lib/ansible/plugins/connection/__init__.py @@ -49,7 +49,8 @@ BUFSIZE = 65536 def ensure_connect(func): @wraps(func) def wrapped(self, *args, **kwargs): - self._connect() + if not self._connected: + self._connect() return func(self, *args, **kwargs) return wrapped