Skip to content

ansible

Ansible playbooks, roles, and collections: the lint rules of the Ansible project.

A scope has file paths **/ansible.cfg, **/playbook.{yml,yaml}, **/playbooks/*.{yml,yaml}, **/inventory/*.{ini,yml,yaml}, or **/inventory/hosts*.

Runs ansible-lint beside each ansible.cfg or at the scope root, with the moderate profile at level basic and the production profile at level all.

Runs at the commit stage, once per scope, on macOS and Linux, and loads your code.

Playbooks run as root on production hosts, and a non-idempotent task changes them each time.

Change the task the way the rule says.

A task with ansible.builtin.command: systemctl restart nginx reports command-instead-of-module. Use ansible.builtin.systemd with name: nginx and state: restarted instead.

gspot ignore ansible/ansible-lint --paths "<path>" --reason "<why>"
gspot ignore ansible/ansible-lint --rule <rule> --reason "<why>"
Rule file Installed when
.gspot/rules/ANSIBLE.md Always
Tool Version
ansible-lint 26.10.1

.gspot/configurations/ansible/ansible-lint.yml