mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 11:21:25 -07:00
ANSIBLE_SSH_USETTY configuration option (#33148)
* Allow the user to circumvent adding -tt on ssh commands to help aid in debugging ssh related problems. * Move config to the plugin * Set version_added * Change yaml section to "connection" * Fix ssh unit tests
This commit is contained in:
parent
aa42a2680e
commit
218987eac1
3 changed files with 26 additions and 1 deletions
|
@ -185,6 +185,15 @@ DOCUMENTATION = '''
|
|||
env: [{name: ANSIBLE_SCP_IF_SSH}]
|
||||
ini:
|
||||
- {key: scp_if_ssh, section: ssh_connection}
|
||||
use_tty:
|
||||
version_added: '2.5'
|
||||
default: True
|
||||
description: add -tt to ssh commands to force tty allocation
|
||||
env: [{name: ANSIBLE_SSH_USETTY}]
|
||||
ini:
|
||||
- {key: usetty, section: ssh_connection}
|
||||
type: boolean
|
||||
yaml: {key: connection.usetty}
|
||||
'''
|
||||
|
||||
import errno
|
||||
|
@ -957,7 +966,11 @@ class Connection(ConnectionBase):
|
|||
|
||||
ssh_executable = self._play_context.ssh_executable
|
||||
|
||||
if not in_data and sudoable:
|
||||
# -tt can cause various issues in some environments so allow the user
|
||||
# to disable it as a troubleshooting method.
|
||||
use_tty = self.get_option('use_tty')
|
||||
|
||||
if not in_data and sudoable and use_tty:
|
||||
args = (ssh_executable, '-tt', self.host, cmd)
|
||||
else:
|
||||
args = (ssh_executable, self.host, cmd)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue