Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

detection of ansible version is broken #7

Closed
larsf opened this issue Sep 10, 2019 · 2 comments
Closed

detection of ansible version is broken #7

larsf opened this issue Sep 10, 2019 · 2 comments

Comments

@larsf
Copy link

larsf commented Sep 10, 2019

currently you check for the ansible version being greater than 2.0 as follows:

49 if (/1.\d+.\d+/.exec(output)) {

that does no work when the output of ansible-playbook --version is as follows:

ansible-playbook 2.8.4
config file = None
configured module search path = ['/Users/lfredriksen/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/Cellar/ansible/2.8.4/libexec/lib/python3.7/site-packages/ansible
executable location = /usr/local/bin/ansible-playbook
python version = 3.7.4 (default, Jul 9 2019, 18:13:23) [Clang 10.0.1 (clang-1001.0.46.4)]

because the regex you have will match on clang-1001.0.46

suggest you agment the regex to something like:
if (/ansible-playbook 1.\d+.\d+/.exec(output)) {

@mschuchard
Copy link
Owner

The version check was improved to be more accurate in a recent commit. It will be reflected in the next release.

@walterrowe
Copy link
Contributor

walterrowe commented Aug 7, 2020

This issue should be reopened. It is still broken 11 months later.

% /usr/local/bin/ansible-playbook --version
ansible-playbook 2.9.11
  config file = /Users/wrowe/git-repos/examples/ansible.cfg
  configured module search path = ['/Users/wrowe/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/Cellar/ansible/2.9.11/libexec/lib/python3.8/site-packages/ansible
  executable location = /usr/local/bin/ansible-playbook
  python version = 3.8.5 (default, Jul 21 2020, 10:48:26) [Clang 11.0.3 (clang-1103.0.32.62)]

% which ansible-lint                       
/usr/local/bin/ansible-lint
% /usr/local/bin/ansible-lint --version
ansible-lint 4.2.0

I am using ansible on macOS installed with brew.

Screen Shot 2020-08-07 at 10 00 10 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants