Skip to content
This repository has been archived by the owner on Dec 2, 2022. It is now read-only.

Commit

Permalink
Add schema for galaxy.yml files (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea authored Mar 12, 2021
1 parent 108af8a commit ca042eb
Show file tree
Hide file tree
Showing 5 changed files with 628 additions and 1 deletion.
4 changes: 3 additions & 1 deletion conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,9 @@ class YamlItem(JSONSchemaItem):
def runtest(self):
file = Path(self.fspath)
schema = kind_from_path(file)
if schema in ["tasks", "vars", "playbook", "meta", "requirements"]:
if file.name == "galaxy.yml":
schema = "ansible-galaxy"
if schema in ["tasks", "galaxy", "vars", "playbook", "meta", "requirements"]:
schema = f"ansible-{schema}"
if not os.path.isfile(f"f/{schema}.json"):
raise ValidationException(
Expand Down
11 changes: 11 additions & 0 deletions examples/galaxy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: foo
namespace: bar
version: 1.2.3
authors:
- John
readme: ../README.md
description: ...
dependencies:
"other_namespace.collection1": ">=1.0.0"
"other_namespace.collection2": ">=2.0.0,<3.0.0"
"anderson55.my_collection": "*" # note: "*" selects the highest version available
Loading

0 comments on commit ca042eb

Please sign in to comment.