diff --git a/plugins/provisioners/ansible/provisioner/base.rb b/plugins/provisioners/ansible/provisioner/base.rb index abe5d08ea..a2533ea9c 100644 --- a/plugins/provisioners/ansible/provisioner/base.rb +++ b/plugins/provisioners/ansible/provisioner/base.rb @@ -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 diff --git a/test/unit/plugins/provisioners/ansible/provisioner_test.rb b/test/unit/plugins/provisioners/ansible/provisioner_test.rb index 5d8527235..318ad0f19 100644 --- a/test/unit/plugins/provisioners/ansible/provisioner_test.rb +++ b/test/unit/plugins/provisioners/ansible/provisioner_test.rb @@ -325,6 +325,7 @@ VF "2.5.0.0-rc1": VagrantPlugins::Ansible::COMPATIBILITY_MODE_V2_0, "2.x.y.z": VagrantPlugins::Ansible::COMPATIBILITY_MODE_V2_0, "4.3.2.1": VagrantPlugins::Ansible::COMPATIBILITY_MODE_V2_0, + "[core 2.11.0]": VagrantPlugins::Ansible::COMPATIBILITY_MODE_V2_0, } valid_versions.each_pair do |ansible_version, mode| describe "and ansible version #{ansible_version}" do