detects new versions of ansible-4.0.0+

Ansible has switched dependency between version 3.4.0 (ansible-base) and 4.0.0 (ansible-core), which now outputs new version scheme of "ansible [core 2.11.0]" instead of "ansible 2.10.9".
This fix keeps old and new version detection working.
This commit is contained in:
Philipp Panzer 2021-05-25 13:28:22 +02:00
parent cf73ff31e2
commit 89c071d374
No known key found for this signature in database
GPG Key ID: 4C7946FC17FC8B2B

View File

@ -389,7 +389,7 @@ gathered version stdout version:
if ansible_version_pattern
_, @gathered_version, _ = ansible_version_pattern.captures
if @gathered_version
@gathered_version_major = @gathered_version.match(/^(\d)\..+$/).captures[0].to_i
@gathered_version_major = @gathered_version.match(/(\d)\..+$/).captures[0].to_i
end
end
end