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

Report if ansible-lint is broken #57

Closed
ssbarnea opened this issue Apr 5, 2021 · 4 comments
Closed

Report if ansible-lint is broken #57

ssbarnea opened this issue Apr 5, 2021 · 4 comments
Labels

Comments

@ssbarnea
Copy link
Member

ssbarnea commented Apr 5, 2021

As ansible-lint have very special requirements for running, we need to be sure that we run ansible-lint --version and report any potential error in a visible way in the UI.

This should make it easier for users to debug broken or incomplete installs of ansible-lint tool.

Related: ansible/ansible-lint#1507

@ssbarnea ssbarnea changed the title Report it ansible-lint is broken Report if ansible-lint is broken Apr 5, 2021
@webknjaz webknjaz added the new label Aug 16, 2021
@lilatomic
Copy link

I was going to work on this, but there's already a little error popup.
If not installed:

Command failed: ansible-lint  --offline --nocolor -f codeclimate "/tmp/vsc/playbook.yml"
/bin/sh: 1: ansible-lint: not found

If pointing to the ansible-lint in a venv without pointing the rest of the extension to the venv:

Command failed: ./.venv/bin/python /tmp/vsc/.venv/bin/ansible-lint  --offline --nocolor -f codeclimate "/tmp/vsc/playbook.yml"
Failed to guess project directory using git: 
ERROR    No module named 'ansible'
FATAL: ansible-lint requires a version of Ansible package >= 2.9, but none was found. Please install a compatible version using the same python interpreter. See https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#installing-ansible-with-pip

I think this issue already done?

@priyamsahoo
Copy link
Collaborator

@ssbarnea, @lilatomic This PR: ansible/ansible-language-server#5 takes care of the following issue. If there is some problem in installation or configuration of ansible-lint, it reports the user and falls back to --syntax-check.

@yoshiotobe
Copy link

ansible-lint does not work with this extension but works with a previous extension below.

https://marketplace.visualstudio.com/items?itemName=tomaciazek.ansible

The previous one shows red error with ansible-lint as below.

スクリーンショット 2021-10-06 182805

However, this extension does not with the same setting.

スクリーンショット 2021-10-06 182901

I set ansible.path, ansibleLint.path, and python.interpreterPath, but does not work. Other features such as autocompletion are working.

My environment is below.

  • OS
    WSL (venv)

  • ansible --version
    ansible [core 2.11.2]
    config file = /home/ubuntu/venv/heart-ansible/ansible.cfg
    configured module search path = ['/home/ubuntu/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
    ansible python module location = /home/ubuntu/venv/lib/python3.8/site-packages/ansible
    ansible collection location = /home/ubuntu/.ansible/collections:/usr/share/ansible/collections
    executable location = /home/ubuntu/venv/bin/ansible
    python version = 3.8.5 (default, May 27 2021, 13:30:53) [GCC 9.3.0]
    jinja version = 3.0.1
    libyaml = True

  • ansible-lint --version
    ansible-lint 5.0.12 using ansible 2.11.2

I hope to use ansible-lint with new extension as previous one is deprecated.

@tumbl3w33d
Copy link

tumbl3w33d commented Feb 10, 2022

The Ansible extension 0.7.1 still doesn't have ansible-lint integration working, as @yoshiotobe demonstrated above.

ansible-lint 5.3.2 using ansible 2.12.1

Update: works with extension 0.8.1 and ansible-lint 5.4.0 using ansible 2.12.3

ssbarnea added a commit that referenced this issue Mar 15, 2024
* update module completion return statement to support fqcn returns whenever necessary

* fix order of priority in filtering of text when FQCN is used

Co-authored-by: Sorin Sbarnea <ssbarnea@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants