A plugin for the IntelliJ platform utilizing Ansible Lint.
Your system needs to have Ansible Lint version 6.14.3
(or later) installed.
(Previous versions should work; but may not provide optimal/expected results.)
NOTE
The plugin does not detect or use any (virtual) environment settings of your current project to run ansible-lint
.
Alternative installation methods (like Poetry, Homebrew, etc.) are also not supported.
ansible-lint
needs to be runnable directly from your computer's command line.
If your package manager doesn't provide ansible-lint
or you want to install a more up-to-date version, then a suggested setup would be as follows:
-
create an
ansible-lint
folder in your home directory:mkdir ~/ansible-lint
-
change into it, and create a dedicated virtual environment:
cd ~/ansible-lint python3 -m venv venv
-
activate the virtual environment and install
ansible-lint
viapip
:source venv/bin/activate pip install ansible-lint
-
finally, create this script file (
~/ansible-lint/run.sh
):#!/bin/bash source ~/ansible-lint/venv/bin/activate ansible-lint "${@}"
-
don't forget to make it executable:
chmod +x ~/ansible-lint/run.sh
Reference this script in the plugin; and you should be ready to go. 👍
(Using pipx to install specific versions of ansible
and ansible-lint
is also a valid alternative; reportedly working fine.)
The plugin now officially supports WSL.
However, I still consider the implementation as "experimental".
I tested everything myself using a standard WSL-installation on Windows11 with Ubuntu as distro.
Simply install ansible
and ansible-lint
using the apt
package manager; then set ansible-lint
as command in the settings-dialog and activate the "Use WSL" checkbox.
Feel free to give feedback if it works for you as well.
Use the IDE's built-in plugin system:
File
-->Settings...
-->Plugins
-->Marketplace
- search for:
Ansible Lint
- click the
Install
-button
Or go to the plugin page on the JetBrains-website, download the archive-file and install manually.
After installing the plugin you should go to the settings dialog and hit the Test
button to check if ansible-lint
is fully operable.
Adjust the command path and/or options as needed.
By default, the plugin will only start linting YAML-files if your project root contains one of these configuration files:
.ansible-lint
.config/ansible-lint.yml
You can eiter create one manually or use the statusbar pop-up actions; which will be available when a YAML file is opened (and no config file is present):
It is possible to use the plugin without a config file (see settings dialog above).
However, this would mean that every YAML-file will unnecessarily be passed to ansible-lint
; even in Non-Ansible projects.
Please read the license file.
- Ansible logo - simpleicons.org
- Check pictogram - Bootstrap Icons
- Heart icon - FontAwesome
If you like this plugin, please consider a donation. Thank you!