8000 Add Ansible Inventory schema by ssbarnea · Pull Request #125 · ansible/schemas · GitHub
[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.

Add Ansible Inventory schema #125

Merged
merged 1 commit into from
Jan 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions examples/inventory.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
all:
hosts:
mail.example.com:
children:
webservers:
hosts:
foo.example.com:
bar[01:50:2].example.com:
dbservers:
hosts:
one.example.com:
two.example.com:
three.example.com:
46 changes: 46 additions & 0 deletions f/ansible-inventory.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"title": "Ansible Inventory Schema",
"description": "Ansible Inventory Schema",
"type": "object",
"examples": [
"inventory.yaml",
"inventory.yml"
],
"definitions": {
"group": {
"type": "object",
"properties": {
"hosts": {
"type": [
"object",
"string"
],
"patternProperties": {
"[a-zA-Z.-_0-9]": {
"type": [
"object",
"null"
]
}
}
},
"vars": {
"type": "object"
},
"children": {
"patternProperties": {
"[a-zA-Z-_0-9]": {
"$ref": "#/definitions/group"
}
}
}
}
}
},
"properties": {
"all": {
"$ref": "#/definitions/group"
}
}
}
0