1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

#4227 in upstream repo

This commit is contained in:
nextus 2013-09-25 16:15:49 +04:00
parent 776fc044dd
commit ca96d74572
3 changed files with 11 additions and 6 deletions

View file

@ -98,9 +98,12 @@ filter_plugins = /usr/share/ansible_plugins/filter_plugins
# uncomment this line to cause the paramiko connection plugin to not record new host # uncomment this line to cause the paramiko connection plugin to not record new host
# keys encountered. Increases performance on new host additions. Setting works independently of the # keys encountered. Increases performance on new host additions. Setting works independently of the
# host key checking setting above. # host key checking setting above.
#record_host_keys=False #record_host_keys=False
# by default, Ansible request a pseudo-terminal for commands execuded under sudo. Uncomment this
# line for override this behaviour.
#pty=False
[ssh_connection] [ssh_connection]
# ssh arguments to use # ssh arguments to use

View file

@ -133,6 +133,7 @@ ANSIBLE_NOCOWS = get_config(p, DEFAULTS, 'nocows', 'ANSIBLE_NOCO
ANSIBLE_SSH_ARGS = get_config(p, 'ssh_connection', 'ssh_args', 'ANSIBLE_SSH_ARGS', None) ANSIBLE_SSH_ARGS = get_config(p, 'ssh_connection', 'ssh_args', 'ANSIBLE_SSH_ARGS', None)
ANSIBLE_SSH_CONTROL_PATH = get_config(p, 'ssh_connection', 'control_path', 'ANSIBLE_SSH_CONTROL_PATH', "%(directory)s/ansible-ssh-%%h-%%p-%%r") ANSIBLE_SSH_CONTROL_PATH = get_config(p, 'ssh_connection', 'control_path', 'ANSIBLE_SSH_CONTROL_PATH', "%(directory)s/ansible-ssh-%%h-%%p-%%r")
PARAMIKO_RECORD_HOST_KEYS = get_config(p, 'paramiko_connection', 'record_host_keys', 'ANSIBLE_PARAMIKO_RECORD_HOST_KEYS', True, boolean=True) PARAMIKO_RECORD_HOST_KEYS = get_config(p, 'paramiko_connection', 'record_host_keys', 'ANSIBLE_PARAMIKO_RECORD_HOST_KEYS', True, boolean=True)
PARAMIKO_PTY = get_config(p, 'paramiko_connection', 'pty', 'ANSIBLE_PARAMIKO_PTY', True, boolean=True)
ZEROMQ_PORT = int(get_config(p, 'fireball_connection', 'zeromq_port', 'ANSIBLE_ZEROMQ_PORT', 5099)) ZEROMQ_PORT = int(get_config(p, 'fireball_connection', 'zeromq_port', 'ANSIBLE_ZEROMQ_PORT', 5099))
ACCELERATE_PORT = int(get_config(p, 'accelerate', 'accelerate_port', 'ACCELERATE_PORT', 5099)) ACCELERATE_PORT = int(get_config(p, 'accelerate', 'accelerate_port', 'ACCELERATE_PORT', 5099))

View file

@ -196,11 +196,12 @@ class Connection(object):
chan.exec_command(quoted_command) chan.exec_command(quoted_command)
else: else:
# sudo usually requires a PTY (cf. requiretty option), therefore # sudo usually requires a PTY (cf. requiretty option), therefore
# we give it one, and we try to initialise from the calling # we give it one by default (pty=True in ansble.cfg), and we try
# environment # to initialise from the calling environment
chan.get_pty(term=os.getenv('TERM', 'vt100'), if C.PARAMIKO_PTY:
width=int(os.getenv('COLUMNS', 0)), chan.get_pty(term=os.getenv('TERM', 'vt100'),
height=int(os.getenv('LINES', 0))) width=int(os.getenv('COLUMNS', 0)),
height=int(os.getenv('LINES', 0)))
shcmd, prompt = utils.make_sudo_cmd(sudo_user, executable, cmd) shcmd, prompt = utils.make_sudo_cmd(sudo_user, executable, cmd)
vvv("EXEC %s" % shcmd, host=self.host) vvv("EXEC %s" % shcmd, host=self.host)
sudo_output = '' sudo_output = ''