Mercurial > repos > other > Puppet
comparison modules/ssh/lib/facter/ssh.rb @ 385:d9009f54eb23
Migrate to a fully-fledged SSH module
This handles lots of the server path differences for us
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Mon, 03 Jan 2022 17:05:54 +0000 |
parents | |
children | adf6fe9bbc17 |
comparison
equal
deleted
inserted
replaced
384:22e45bb5ea97 | 385:d9009f54eb23 |
---|---|
1 Facter.add('ssh_version') do | |
2 setcode do | |
3 if Facter::Util::Resolution.which('ssh') | |
4 Facter::Util::Resolution.exec('ssh -V 2>&1').match(/^[A-Za-z0-9._]+/)[0] | |
5 end | |
6 end | |
7 end | |
8 | |
9 Facter.add('ssh_version_numeric') do | |
10 setcode do | |
11 ssh_version = Facter.value(:ssh_version) | |
12 if ssh_version | |
13 ssh_version.match(/(\d+\.\d+\.\d+|\d+\.\d+)/)[0] | |
14 end | |
15 end | |
16 end |