ansible/ansible — pull request #3313 by madduck (2013-06-22 08:41:02+00:00)
Title: Add facts for SSH versions

This extends the setup module and adds facts to capture the versions of
SSH (client and server), e.g.

"ansible_ssh_build_date": "01 Jun 2010",
"ansible_ssh_distro_version": "Debian-6+squeeze3",
"ansible_ssh_openssl_version": "0.9.8o",
"ansible_ssh_product": "OpenSSH",
"ansible_ssh_version": "5.5p1",
"ansible_ssh_version_parts": [ "5", "5", "p1" ],
"ansible_sshd_build_date": "01 Jun 2010",
"ansible_sshd_distro_version": "Debian-6+squeeze3",
"ansible_sshd_openssl_version": "0.9.8o",
"ansible_sshd_product": "OpenSSH",
"ansible_sshd_version": "5.5p1",
"ansible_sshd_version_parts": [ "5", "5", "p1" ]

There are two shortcomings at the moment:

1. Only OpenSSH is supported, but it should be easy to add support for
other SSH products;

2. /usr/sbin/sshd is hardcoded to allow non-root users to obtain the
sshd version. If there is no sshd at this location, then only
a fact like {'sshd':'/usr/sbin/sshd not found'} is generated.

Signed-off-by: martin f. krafft