# ansible/ansible-lint

> Runs the moderate ansible-lint profile at recommended and production at all, beside each ansible.cfg or at the scope root.

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

Part of the [`ansible`](/reference/configurations/ansible/) configuration, at the `recommended` [level](/start/concepts/#levels). It runs at the `commit` [stage](/start/concepts/#stage), once per scope. It runs ansible-lint.

## Why

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

## What to do

Change the task the way the rule says. Turn one rule off with `gspot ignore ansible/ansible-lint --rule <id> --reason "<why>"`.

## 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

Turn it off for some files, or one of its lint rules, with a reason:

```shell
gspot ignore ansible/ansible-lint --paths "<glob>" --reason "<why>"
gspot ignore ansible/ansible-lint --rule <rule> --reason "<why>"
```
