Now ssh pipeline is off by default (p.s., PR #13200 has some problems). We can make ssh pipeline more smart way, that is, enable it as much as possible for each host after the setup module is done.
Problems
default performance is not well optimized
setting ssh_pipelining to improve performance need additional knowledge, such as a) current operations to do; b) remote controlled machine environments; c) which become method is used
Solution proposal
in ansible.cfg, pipelining can be set to 'smart'/True/False
if set to smart (by default), setup module will set ansible_ssh_pipelining as a host fact
when detecting on remote machines:
if not find sudo, set ansible_ssh_pipelining to True
run some command such as echo id | sudo -S -n sh, if find 'you must have a tty to run sudo' in stderr, set ansible_ssh_pipelining to False
other cases, set ansible_ssh_pipelining to True
when executing a non-become task, always enable ssh pipelining, even if ansible_ssh_pipelining is False
each become method could override ansible_ssh_pipelining is different way, such as su should always disable pipe (this is already done)
Proposal: enable ssh pipelining in a more smart way
Author: James Z.M. Gao <@gzm55>
Date: 2017/10/27
Motivation
This is previous a issue in ansible project.
Now ssh pipeline is off by default (p.s., PR #13200 has some problems). We can make ssh pipeline more smart way, that is, enable it as much as possible for each host after the setup module is done.
Problems
Solution proposal
echo id | sudo -S -n sh
, if find 'you must have a tty to run sudo' in stderr, set ansible_ssh_pipelining to FalseDependencies
N/A
Testing
TBD
Documentation
TBD