amrox / asdf-pyapp

A generic Python Application plugin the asdf version manager.
MIT License
60 stars 8 forks source link

Ansible not compatible with its ecosystem #30

Closed FedericoAntoniazzi closed 1 year ago

FedericoAntoniazzi commented 1 year ago

Describe the bug

When using ansible from asdf, ansible-lint won't work due to the following error:

❯ ansible-lint playbook.yml
Ansible CLI (2.14.6) and python module (2.15.2) versions do not match. This indicates a broken execution environment.

Steps to reproduce

  1. Install ansible using asdf as reported in the README
  2. configure asdf and direnv in a project for using older versions of ansible (e.g. 7.6.0)
  3. In that project, try to run ansible-lint

Expected behavior I expect ansible-lint to run without reporting the error of a broken execution environment.

amrox commented 1 year ago

I am an extremely light user of ansible, but the following worked for me:

✦ ❯ cat ../.tool-versions
ansible 7.7.0@3.10.12
ansible-lint 6.17.2@3.10.12

✦ ❯ which ansible-lint
/home/amrox/.asdf/installs/ansible-lint/6.17.2@3.10.12/bin/ansible-lint

✦ ❯ ansible-lint .
WARNING: PATH altered to include /home/amrox/.asdf/installs/ansible-lint/6.17.2@3.10.12/venv/bin :: This is usually a sign of broken local setup, which can cause unexpected behaviors.

Passed: 0 failure(s), 0 warning(s) on 1 files. Last profile that met the validation criteria was 'production'.

Maybe try installing ansible-lint with asdf-pyapp as well?

FedericoAntoniazzi commented 1 year ago

Thanks for your reply. I was missing the fact that asdf-pyapp works with literally every python app, checked the README and didn't find ansible-lint.