diff --git a/examples/inventory.yml b/examples/inventory.yml new file mode 100644 index 00000000..48a0e6a5 --- /dev/null +++ b/examples/inventory.yml @@ -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: diff --git a/f/ansible-inventory.json b/f/ansible-inventory.json new file mode 100644 index 00000000..f78f46f9 --- /dev/null +++ b/f/ansible-inventory.json @@ -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" + } + } +}