geerlingguy / drupal-vm

A VM for Drupal development
https://www.drupalvm.com/
MIT License
1.38k stars 644 forks source link

Issue #2166: Fix new ansible version output doesnt match regex #2167

Closed oxyc closed 3 years ago

kekkis commented 3 years ago

FWIW, with this change in place, I ran a vagrant up successfully both using Homebrew's latest Ansible:

ansible: stable 4.0.0 (bottled), HEAD

And Homebrew's ansible@2.9:

ansible@2.9: stable 2.9.22 (bottled) [keg-only]
oxyc commented 3 years ago

ansible@2.9: stable 2.9.22 (bottled) [keg-only]

With this it actually detectes 2.9 and not 2.9.22 but maybe that's fine

oxyc commented 3 years ago

Could always make it: /\s(#{Gem::Version::VERSION_PATTERN})/

ansible 2.1.3 # works
ansible 2.1.3-beta # works
ansible [core 2.13] # works
ansible: stable 4.0.0 (bottled), HEAD # works
ansible@2.9: stable 2.9.22 (bottled) [keg-only] # works
ansible 3 [core 3.13] # would not work
kekkis commented 3 years ago

@oxyc These snippets were from brew info, not from ansible --version. The ansible --version outputs are, of course:

ansible@2.9

ansible --version
ansible 2.9.22
  config file = None
  configured module search path = ['/Users/kekkis/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/Cellar/ansible@2.9/2.9.22/libexec/lib/python3.9/site-packages/ansible
  executable location = /usr/local/opt/ansible@2.9/bin/ansible
  python version = 3.9.5 (default, May  4 2021, 03:33:11) [Clang 12.0.0 (clang-1200.0.32.29)]

ansible 4.0.0:

ansible [core 2.11.0]
  config file = None
  configured module search path = ['/Users/kekkis/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/Cellar/ansible/4.0.0/libexec/lib/python3.9/site-packages/ansible
  ansible collection location = /Users/kekkis/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.9.5 (default, May  4 2021, 03:33:11) [Clang 12.0.0 (clang-1200.0.32.29)]
  jinja version = 3.0.1
  libyaml = True