Giter VIP home page Giter VIP logo

Comments (4)

yoshiotobe avatar yoshiotobe commented on May 25, 2024 3

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.

from vscode-ansible.

lilatomic avatar lilatomic commented on May 25, 2024

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?

from vscode-ansible.

priyamsahoo avatar priyamsahoo commented on May 25, 2024

@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.

from vscode-ansible.

tumbl3w33d avatar tumbl3w33d commented on May 25, 2024

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

from vscode-ansible.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.