Guest User

Untitled

a guest
Nov 22nd, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. diff --git a/lib/ansible/plugins/connection/ssh.py b/lib/ansible/plugins/connection/ssh.py
  2. index 6207e31a05..bb024e240f 100644
  3. --- a/lib/ansible/plugins/connection/ssh.py
  4. +++ b/lib/ansible/plugins/connection/ssh.py
  5. @@ -185,6 +185,15 @@ DOCUMENTATION = '''
  6. env: [{name: ANSIBLE_SCP_IF_SSH}]
  7. ini:
  8. - {key: scp_if_ssh, section: ssh_connection}
  9. + use_tty:
  10. + default: True
  11. + description: add -tt to ssh commands to force tty allocation
  12. + env: [{name: ANSIBLE_SSH_USETTY}]
  13. + ini:
  14. + - {key: usetty, section: ssh_connection}
  15. + type: boolean
  16. + vars:
  17. + - name: ansible_ssh_usetty
  18. '''
  19.  
  20. import errno
  21. @@ -957,7 +966,7 @@ class Connection(ConnectionBase):
  22.  
  23. ssh_executable = self._play_context.ssh_executable
  24.  
  25. - if not in_data and sudoable:
  26. + if not in_data and sudoable and self._options['use_tty']:
  27. args = (ssh_executable, '-tt', self.host, cmd)
  28. else:
  29. args = (ssh_executable, self.host, cmd)
Add Comment
Please, Sign In to add comment