Skip to content

Commit

Permalink
schema: enable validation of playbook and tasks files (#2133)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea authored May 14, 2022
1 parent 0d89284 commit 805f461
Show file tree
Hide file tree
Showing 8 changed files with 2,191 additions and 9 deletions.
2 changes: 1 addition & 1 deletion examples/playbooks/example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@
ansible.builtin.apt: state=latest name=apache2

- ansible.builtin.meta: flush_handlers
# empty task is currently accepted by ansible as valid code:
# empty task is currently accepted by ansible as valid code but not our schemas:
-
7 changes: 3 additions & 4 deletions src/ansiblelint/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,9 @@
# Maps kinds to JSON schemas
# See https://www.schemastore.org/json/
JSON_SCHEMAS = {
# playbook and task schemas not used yet due jsonschema bug:
# https://github.com/python-jsonschema/jsonschema/issues/931
# "playbook": "https://raw.githubusercontent.com/ansible/schemas/main/f/ansible.json#/definitions/playbook",
# "tasks": "https://raw.githubusercontent.com/ansible/schemas/main/f/ansible.json#/definitions/tasks",
# Do not use anchors in these URLs because python-jsonschema does not support them:
"playbook": "https://raw.githubusercontent.com/ansible/schemas/main/f/ansible-playbook.json",
"tasks": "https://raw.githubusercontent.com/ansible/schemas/main/f/ansible-tasks.json",
"vars": "https://raw.githubusercontent.com/ansible/schemas/main/f/ansible-vars.json",
"requirements": "https://raw.githubusercontent.com/ansible/schemas/main/f/ansible-requirements.json",
"meta": "https://raw.githubusercontent.com/ansible/schemas/main/f/ansible-meta.json",
Expand Down
Loading

0 comments on commit 805f461

Please sign in to comment.