Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ansible/ansible.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Coca <bcoca@users.noreply.github.com>2018-05-25 06:38:16 +0300
committeransibot <ansibot@users.noreply.github.com>2018-05-25 06:38:16 +0300
commit3b8b928e29c62f60a1b785e573209b40cd14b4c6 (patch)
tree29b542431caa57d86ecf434ad5f42c8f9dfb59af /examples
parentbc930389430e2549acbc8da5e89066350e91f4ee (diff)
draft schema for inventory scripts (#39454)
* draft schema for inventory scripts used by the script inventory plugin * fixes and details for vars * proper escape * restrict additional
Diffstat (limited to 'examples')
-rw-r--r--examples/inventory_script_schema.json53
1 files changed, 53 insertions, 0 deletions
diff --git a/examples/inventory_script_schema.json b/examples/inventory_script_schema.json
new file mode 100644
index 00000000000..c68b7f82700
--- /dev/null
+++ b/examples/inventory_script_schema.json
@@ -0,0 +1,53 @@
+{
+ "$schema": "http://json-schema.org/draft-06/schema#",
+ "title": "Ansible Inventory",
+ "description" : "Ansible Inventory for the script inventory plugin",
+ "type": "object",
+ "patternProperties": {
+ "^\\w$":{
+ "type": "object",
+ "properties": {
+ "hosts": {
+ "description" : "list of hosts that are part of this group",
+ "type": "array",
+ "items": { "type": "string" }
+ },
+ "vars": {
+ "type": "object",
+ "description": "Variables to assign to hosts that are part of this group" ,
+ "patternProperties": {
+ "^\\w$":{ "type": "object", "description" : "Vars for this hosts in this group" }
+ }
+ },
+ "children": {
+ "description" : "list of groups that are children of this group, their hosts will be added to this group",
+ "type": "array",
+ "items": { "type": "string" }
+ }
+ },
+ "additionalProperties": false
+ },
+ "_meta":{
+ "type": "object",
+ "description" : "Key that avoids calling the script per host",
+ "required": ["hostvars"],
+ "properties": {
+ "hostvars": {
+ "type": "object",
+ "description" : "Each key is a hostname and the value is a dictionary of the variables for that host",
+ "patternProperties": {
+ "^\\w$":{
+ "type": "object",
+ "description" : "Hosts with their associated vars",
+ "patternProperties": {
+ "^\\w$":{ "type": "object", "description" : "Vars for this host" }
+ }
+ }
+ }
+ }
+ },
+ "additionalProperties": false
+ }
+ },
+ "additionalProperties": false
+}