ansible
Ansible playbooks, roles, and collections: the lint rules of the Ansible project.
Selected when
Section titled “Selected when”A scope has file paths **/ansible.cfg, **/playbook.{yml,yaml}, **/playbooks/*.{yml,yaml}, **/inventory/*.{ini,yml,yaml}, or **/inventory/hosts*.
Checks
Section titled “Checks”ansible-lint
Section titled “ansible-lint”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.
What to do
Section titled “What to do”Change the task the way the rule says.
Example
Section titled “Example”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.
Turn it off
Section titled “Turn it off”gspot ignore ansible/ansible-lint --paths "<path>" --reason "<why>"gspot ignore ansible/ansible-lint --rule <rule> --reason "<why>"Rules for coding agents
Section titled “Rules for coding agents”| Rule file | Installed when |
|---|---|
.gspot/rules/ANSIBLE.md |
Always |
Tools and versions
Section titled “Tools and versions”| Tool | Version |
|---|---|
| ansible-lint | 26.10.1 |
Files gspot writes
Section titled “Files gspot writes”.gspot/configurations/ansible/ansible-lint.yml