Skip to content

Commit

Permalink
Updated schemas (#2206)
Browse files Browse the repository at this point in the history
Notable change is that some old with_ statements were no longer
allowed, forcing use of FQCN notation or loop.
  • Loading branch information
ssbarnea authored Jun 9, 2022
1 parent 41cb0b1 commit d33263d
Show file tree
Hide file tree
Showing 4 changed files with 295 additions and 115 deletions.
39 changes: 37 additions & 2 deletions src/ansiblelint/schemas/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,8 @@
"type": "string"
},
"when": {
"title": "When",
"type": "string"
"$ref": "#/$defs/complex_conditional",
"title": "When"
}
},
"title": "Dependency entry",
Expand Down Expand Up @@ -832,6 +832,25 @@
"title": "OpenBSDPlatformModel",
"type": "object"
},
"OpenWRTPlatformModel": {
"properties": {
"name": {
"const": "OpenWRT",
"title": "Name",
"type": "string"
},
"versions": {
"default": "all",
"items": {
"enum": ["17.01", "18.06", "19.07", "21.02", "all"],
"type": "string"
},
"type": "array"
}
},
"title": "OpenWRTPlatformModel",
"type": "object"
},
"PAN-OSPlatformModel": {
"properties": {
"name": {
Expand Down Expand Up @@ -1079,6 +1098,22 @@
"title": "aosPlatformModel",
"type": "object"
},
"complex_conditional": {
"oneOf": [
{
"type": "boolean"
},
{
"type": "string"
},
{
"items": {
"type": "string"
},
"type": "array"
}
]
},
"eosPlatformModel": {
"properties": {
"name": {
Expand Down
145 changes: 73 additions & 72 deletions src/ansiblelint/schemas/playbook.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
"title": "Name",
"type": "string"
},
"tags": {
"$ref": "#/$defs/tags"
},
"vars": {
"title": "Vars",
"type": "object"
Expand Down Expand Up @@ -171,8 +174,7 @@
"$ref": "#/$defs/templated-boolean"
},
"port": {
"title": "Port",
"type": "integer"
"$ref": "#/$defs/templated-integer"
},
"remote_user": {
"title": "Remote User",
Expand All @@ -197,26 +199,16 @@
"title": "Run Once"
},
"tags": {
"anyOf": [
{
"type": "string"
},
{
"items": {
"type": "string"
},
"type": "array"
}
],
"$ref": "#/$defs/tags",
"title": "Tags"
},
"throttle": {
"$ref": "#/$defs/templated-integer",
"title": "Throttle"
},
"timeout": {
"title": "Timeout",
"type": "integer"
"$ref": "#/$defs/templated-integer",
"title": "Timeout"
},
"vars": {
"title": "Vars",
Expand Down Expand Up @@ -361,8 +353,8 @@
"type": "boolean"
},
"gather_timeout": {
"title": "Gather Timeout",
"type": "integer"
"$ref": "#/$defs/templated-integer",
"title": "Gather Timeout"
},
"handlers": {
"$ref": "#/$defs/tasks"
Expand Down Expand Up @@ -414,8 +406,8 @@
"type": "string"
},
"port": {
"title": "Port",
"type": "integer"
"$ref": "#/$defs/templated-integer",
"title": "Port"
},
"post_tasks": {
"$ref": "#/$defs/tasks"
Expand Down Expand Up @@ -478,17 +470,7 @@
"type": "string"
},
"tags": {
"anyOf": [
{
"type": "string"
},
{
"items": {
"type": "string"
},
"type": "array"
}
],
"$ref": "#/$defs/tags",
"title": "Tags"
},
"tasks": {
Expand All @@ -499,8 +481,8 @@
"title": "Throttle"
},
"timeout": {
"title": "Timeout",
"type": "integer"
"$ref": "#/$defs/templated-integer",
"title": "Timeout"
},
"vars": {
"title": "Vars",
Expand Down Expand Up @@ -606,8 +588,8 @@
"$ref": "#/$defs/templated-boolean"
},
"port": {
"title": "Port",
"type": "integer"
"$ref": "#/$defs/templated-integer",
"title": "Port"
},
"remote_user": {
"title": "Remote User",
Expand All @@ -622,26 +604,16 @@
"title": "Run Once"
},
"tags": {
"anyOf": [
{
"type": "string"
},
{
"items": {
"type": "string"
},
"type": "array"
}
],
"$ref": "#/$defs/tags",
"title": "Tags"
},
"throttle": {
"$ref": "#/$defs/templated-integer",
"title": "Throttle"
},
"timeout": {
"title": "Timeout",
"type": "integer"
"$ref": "#/$defs/templated-integer",
"title": "Timeout"
},
"vars": {
"title": "Vars",
Expand All @@ -658,13 +630,55 @@
"title": "play-role",
"type": "object"
},
"tags": {
"anyOf": [
{
"type": "string"
},
{
"items": {
"type": "string"
},
"type": "array"
}
],
"title": "Tags"
},
"task": {
"additionalProperties": true,
"not": {
"required": [
"block"
]
},
"allOf": [
{
"not": {
"required": [
"block"
]
}
},
{
"not": {
"required": [
"with_filetree"
]
},
"title": "with_filetree was moved to with_community.general.filetree in 2.10"
},
{
"not": {
"required": [
"with_flattened"
]
},
"title": "with_flattened was moved to with_community.general.flattened in 2.10"
},
{
"not": {
"required": [
"with_cartesian"
]
},
"title": "with_cartesian was moved to with_community.general.cartesian in 2.10"
}
],
"properties": {
"action": {
"title": "Action",
Expand All @@ -679,8 +693,8 @@
"title": "Args"
},
"async": {
"title": "Async",
"type": "integer"
"$ref": "#/$defs/templated-integer",
"title": "Async"
},
"become": {
"$ref": "#/$defs/templated-boolean",
Expand Down Expand Up @@ -726,8 +740,8 @@
"type": "string"
},
"delay": {
"title": "Delay",
"type": "integer"
"$ref": "#/$defs/templated-integer",
"title": "Delay"
},
"delegate_facts": {
"title": "Delegate Facts",
Expand Down Expand Up @@ -821,26 +835,16 @@
"title": "Run Once"
},
"tags": {
"anyOf": [
{
"type": "string"
},
{
"items": {
"type": "string"
},
"type": "array"
}
],
"$ref": "#/$defs/tags",
"title": "Tags"
},
"throttle": {
"$ref": "#/$defs/templated-integer",
"title": "Throttle"
},
"timeout": {
"title": "Timeout",
"type": "integer"
"$ref": "#/$defs/templated-integer",
"title": "Timeout"
},
"until": {
"title": "Until",
Expand All @@ -866,9 +870,6 @@
"with_first_found": {
"title": "With First Found"
},
"with_flattened": {
"title": "With Flattened"
},
"with_indexed_items": {
"title": "With Indexed Items"
},
Expand Down
Loading

0 comments on commit d33263d

Please sign in to comment.