Skip to content

schema

The schema rule validates Ansible metadata files against JSON schemas. These schemas ensure the compatibility of Ansible syntax content across versions.

This schema rule is mandatory. You cannot use inline noqa comments to ignore it.

Ansible-lint validates the schema rule before processing other rules. This prevents unexpected syntax from triggering multiple rule violations.

Validated schema

Ansible-lint currently validates several schemas that are maintained in separate projects and updated independently to ansible-lint.

Report bugs related to schema in their respective repository and not in the ansible-lint project.

Maintained in the ansible-lint project:

Maintained in the ansible-navigator project:

schema[meta]

For meta/main.yml files, Ansible-lint requires a galaxy_info.standalone property that clarifies if a role is an old standalone one or a new one, collection based:

galaxy_info:
  standalone: true # <-- this is a standalone role (not part of a collection)

Ansible-lint requires the standalone key to avoid confusion and provide more specific error messages. For example, the meta schema will require some properties only for standalone roles or prevent the use of some properties that are not supported by collections.

You cannot use an empty meta/main.yml file or use only comments in the meta/main.yml file.

schema[moves]

These errors usually look like "foo was moved to bar in 2.10" and indicate module moves between Ansible versions.