How to get ansible vscode extension working…

AntoineGGG
2 min readApr 17, 2023

Or how to lint your ansible yaml files properly !

Photo by Brett Jordan on Unsplash

For beginners, working with YAML files can sometimes be challenging. Mistakes such as incorrect indentation or using a list instead of a dictionary can result in errors, leading to a frustrating experience with this powerful language.

To address these challenges, I attempted to install a YAML linter extension in Visual Studio Code (VSCode). Additionally, as I started working with Ansible, I received advice to use the Ansible extension for VSCode. However, after installing the extension, I encountered an error message that appeared in the VSCode error window: “Unable to parse YAML playbooks — ERROR: ‘Ansible-lint is not available. Kindly check the path or disable validation using ansible-lint’”.

Resolving this error can be challenging, especially if you are unfamiliar with Ansible lint and how to add its installation folder to the PATH environment variable. To help you navigate this process, here are some steps you can follow:

Firstly, ensure that you have Python’s pip package manager installed. If it is not installed, you can install it by following the appropriate instructions for your operating system.

// Classic update && upgrade of apt

sudo apt update
sudo apt upgrade

// Installation of python pip

sudo apt…

--

--