8000 GitHub - ansible/schemas at v22.4
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Dec 2, 2022. It is now read-only.

ansible/schemas

Repository files navigation

Schemas for Ansible and its related tools

ci Code style: black Repository License: MIT

About Schemas

This project aims to generate JSON/YAML validation schemas for Ansible files such as playbooks, tasks, requirements, meta or vars and also for Molecule configuration.

Keep in mind that these schemas will limit your freedom of choice regarding the syntax you can use to write Ansible tasks as they do not allow some historical forms which are still allowed by Ansible itself.

Not any file accepted by Ansible will pass these schemas but we do expect that any file that passed these schemas should be accepted by Ansible.

  • YAML 1.2 booleans are required as true or false, while Ansible itself allows you to use more relaxed forms like yes or no.
  • Inline actions are not allowed, as schema cannot validate them
  • Non builtin modules must be called using action: blocks
  • Module arguments are not yet verified but we plan to implement it

As these schemas are still experimental, creating pull-requests to improve the schema is of much greater help. Though you are still welcome to report bugs but expect them to take a longer time until someone finds time to fix them.

If you want to help improve the schemas, have a look at the development documentation.

Schema Bundle

We are currently migrating towards a single ansible.json schema bundle, one that contains subschema definitions for all the supported file types.

To configure your validator or editor to use the bundle, use the new URLs below, the part after the # in the URLs is essential for informing the loader about which subschema to use. You can also look at our own settings.json to understand how to configure vscode-yaml extension.

Activating the schemas

At this moment installing Ansible VS Code Extension by Red Hat will activate these schemas. The file patterns used to trigger their use can be seen here

Because these schemas are generic, you can easily use them with any validators that support them.

0