summaryrefslogtreecommitdiffstats
path: root/src/ansiblelint/schemas
diff options
context:
space:
mode:
Diffstat (limited to 'src/ansiblelint/schemas')
-rw-r--r--src/ansiblelint/schemas/__main__.py7
-rw-r--r--src/ansiblelint/schemas/__store__.json26
-rw-r--r--src/ansiblelint/schemas/ansible-lint-config.json13
-rw-r--r--src/ansiblelint/schemas/ansible-navigator-config.json7
-rw-r--r--src/ansiblelint/schemas/ansible.json51
-rw-r--r--src/ansiblelint/schemas/execution-environment.json3
-rw-r--r--src/ansiblelint/schemas/galaxy.json168
-rw-r--r--src/ansiblelint/schemas/inventory.json2
-rw-r--r--src/ansiblelint/schemas/main.py90
-rw-r--r--src/ansiblelint/schemas/meta.json99
-rw-r--r--src/ansiblelint/schemas/molecule.json1
-rw-r--r--src/ansiblelint/schemas/playbook.json62
-rw-r--r--src/ansiblelint/schemas/requirements.json1
-rw-r--r--src/ansiblelint/schemas/role-arg-spec.json178
-rw-r--r--src/ansiblelint/schemas/rulebook.json120
-rw-r--r--src/ansiblelint/schemas/tasks.json22
-rw-r--r--src/ansiblelint/schemas/vars.json1
17 files changed, 756 insertions, 95 deletions
diff --git a/src/ansiblelint/schemas/__main__.py b/src/ansiblelint/schemas/__main__.py
index e3ec8ae..e216c0b 100644
--- a/src/ansiblelint/schemas/__main__.py
+++ b/src/ansiblelint/schemas/__main__.py
@@ -1,4 +1,5 @@
"""Module containing cached JSON schemas."""
+
import json
import logging
import os
@@ -68,7 +69,10 @@ def refresh_schemas(min_age_seconds: int = 3600 * 24) -> int:
raise RuntimeError(msg)
path = Path(__file__).parent.resolve() / f"{kind}.json"
_logger.debug("Refreshing %s schema ...", kind)
- request = Request(url)
+ if not url.startswith(("http:", "https:")):
+ msg = f"Unexpected url schema: {url}"
+ raise ValueError(msg)
+ request = Request(url) # noqa: S310
etag = data.get("etag", "")
if etag:
request.add_header("If-None-Match", f'"{data.get("etag")}"')
@@ -108,7 +112,6 @@ def refresh_schemas(min_age_seconds: int = 3600 * 24) -> int:
get_schema.cache_clear()
else:
store_file.touch()
- changed = 1
return changed
diff --git a/src/ansiblelint/schemas/__store__.json b/src/ansiblelint/schemas/__store__.json
index d4bcdca..d66d675 100644
--- a/src/ansiblelint/schemas/__store__.json
+++ b/src/ansiblelint/schemas/__store__.json
@@ -1,10 +1,10 @@
{
"ansible-lint-config": {
- "etag": "0ec39ba1ca9c20aea463f7f536c6903c88288f47c1b2b2b3d53b527c293f8cc3",
+ "etag": "a0bb8004fad70bab34fad94a45b2698125127142ec6b2c8900976aa2bd96a86c",
"url": "https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/ansible-lint-config.json"
},
"ansible-navigator-config": {
- "etag": "dd0f0dea68266ae61e5a8d6aed0a1279fdee16f2da4911bc27970241df80f798",
+ "etag": "431f1a81acc74fe1112d5839551105bc2fa4e0314d811699eb525dae4fe3760d",
"url": "https://raw.githubusercontent.com/ansible/ansible-navigator/main/src/ansible_navigator/data/ansible-navigator.json"
},
"changelog": {
@@ -12,19 +12,19 @@
"url": "https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/changelog.json"
},
"execution-environment": {
- "etag": "f3abb1716134227ccd667607840dd7bdebfd02a8980603df031282126dc78264",
+ "etag": "2e1b1d02460fb93892252439e9634d9574dfdd37aea82af32f4622dacd5990b5",
"url": "https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/execution-environment.json"
},
"galaxy": {
- "etag": "61f38feb51dc7eaff43ab22f3759b3a5202776ee75ee4204f07135282817f724",
+ "etag": "4224ac235cc5657bf77b5834cea48b4d573cc8b666694f788590e213adfb8113",
"url": "https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/galaxy.json"
},
"inventory": {
- "etag": "3dcd4890bf31e634a7c4f6138286a42b4985393f210f7ffaa840c2127876aa55",
+ "etag": "b52c251a121e2e807928db7b4e09338babde9e74a50d0f74e8908f6e230d101d",
"url": "https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/inventory.json"
},
"meta": {
- "etag": "0f376059285181985711b4271a6ff34a8dde662b9fc221d09bdcd64e4fbf86bf",
+ "etag": "fdff861b226b13b711dd7f94301ed5becd6dc5d8d4e872f909d4a3d8133d600a",
"url": "https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/meta.json"
},
"meta-runtime": {
@@ -32,31 +32,31 @@
"url": "https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/meta-runtime.json"
},
"molecule": {
- "etag": "3456b2e5aaa02fde359ff147cff81d01a37c07f5e10542b6b8b61aaaf8c756a6",
+ "etag": "3b625438c28e884ac42a14c09ca542fc3e1b4466abaf47d0c28646e0857d3fb5",
"url": "https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/molecule.json"
},
"playbook": {
- "etag": "acbd5edfc66279f8c3f6f8a99d0874669a254983ace5e4a2cce6105489ab3e21",
+ "etag": "4f8cbba62fcf8a1fa6e8ef5e42696aec5b0876487478df83a7ffdf8bdbb4abcf",
"url": "https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/playbook.json"
},
"requirements": {
- "etag": "93c6ccd1f79f58134795b85f9b1193d6e18417dd01a9d1f37d9f247562a1e6fe",
+ "etag": "5ae3a6058ac626a341338c760db7cef7f02a8911c7293c7e129dbc6b0f8bb86d",
"url": "https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/requirements.json"
},
"role-arg-spec": {
- "etag": "498a6f716c7e99bd474ae9e7d34b3f43fbf2aad750f769392fc8e29fa590be6c",
+ "etag": "e41a42e1ca634a9eb2edbc4a180f404bdc71e17aafa464e6651387c08152bbc5",
"url": "https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/role-arg-spec.json"
},
"rulebook": {
- "etag": "f0bbd0ecd656b2298febccc6da0ecf4a7bd239cc112b9de8292c1f50bad612e0",
+ "etag": "baba5774a46fcc2bc8c4a8c2f25b49df64a0856e415dbf601b0559f215e55968",
"url": "https://raw.githubusercontent.com/ansible/ansible-rulebook/main/ansible_rulebook/schema/ruleset_schema.json"
},
"tasks": {
- "etag": "f9fbc0855680d1321fa3902181131d73838d922362d8dfb85a4f59402240cc07",
+ "etag": "9f3b54cf5cc432d57c9691fb3108a7f37996ab0875e2abb66eda0aa62437dcdc",
"url": "https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/tasks.json"
},
"vars": {
- "etag": "5d6c2c22a58f2b48c2a8d8d129f2516e4f17ffc78a2c9ba045eb5ede0ff749d7",
+ "etag": "73feaa77561d1d5b0bebe6cd66d499a28d67037055ac6d746139a38c9d28ca04",
"url": "https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/vars.json"
}
}
diff --git a/src/ansiblelint/schemas/ansible-lint-config.json b/src/ansiblelint/schemas/ansible-lint-config.json
index f7d50e4..7f53ffd 100644
--- a/src/ansiblelint/schemas/ansible-lint-config.json
+++ b/src/ansiblelint/schemas/ansible-lint-config.json
@@ -17,6 +17,7 @@
"$id": "https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/ansible-lint-config.json",
"$schema": "http://json-schema.org/draft-07/schema",
"additionalProperties": false,
+ "description": "https://ansible.readthedocs.io/projects/lint/configuring/",
"examples": [
".ansible-lint",
".config/ansible-lint.yml",
@@ -60,6 +61,11 @@
"title": "Loop Var Prefix",
"type": "string"
},
+ "max_block_depth": {
+ "title": "Maximum Block Depth",
+ "type": "integer",
+ "default": 20
+ },
"mock_modules": {
"items": {
"type": "string"
@@ -242,6 +248,13 @@
"title": "Strict",
"type": "boolean"
},
+ "supported_ansible_also": {
+ "items": {
+ "type": "string"
+ },
+ "title": "Add supported ansible versions",
+ "type": "array"
+ },
"tags": {
"items": {
"type": "string"
diff --git a/src/ansiblelint/schemas/ansible-navigator-config.json b/src/ansiblelint/schemas/ansible-navigator-config.json
index e81a878..d528267 100644
--- a/src/ansiblelint/schemas/ansible-navigator-config.json
+++ b/src/ansiblelint/schemas/ansible-navigator-config.json
@@ -1,6 +1,7 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"additionalProperties": false,
+ "description": "See https://ansible.readthedocs.io/projects/navigator/settings/",
"properties": {
"ansible-navigator": {
"additionalProperties": false,
@@ -9,7 +10,7 @@
"additionalProperties": false,
"properties": {
"cmdline": {
- "description": "Extra parameters passed to the corresponding command",
+ "description": "Extra parameters passed to the underlying ansible command (e.g. ansible-playbook, ansible-doc, etc)",
"type": "string"
},
"config": {
@@ -524,7 +525,7 @@
"required": [
"ansible-navigator"
],
- "title": "ansible-navigator settings v3",
+ "title": "ansible-navigator settings v24",
"type": "object",
- "version": "3"
+ "version": "24"
}
diff --git a/src/ansiblelint/schemas/ansible.json b/src/ansiblelint/schemas/ansible.json
index 94846d0..9423f7a 100644
--- a/src/ansiblelint/schemas/ansible.json
+++ b/src/ansiblelint/schemas/ansible.json
@@ -1,5 +1,10 @@
{
"$defs": {
+ "removed-include-module": {
+ "markdownDescription": "See [include module](https://docs.ansible.com/ansible/latest/collections/ansible/builtin/include_module.html)",
+ "not": {},
+ "title": "Replace 'include' with either 'ansible.builtin.include_tasks' or 'ansible.builtin.import_tasks'"
+ },
"ansible.builtin.import_playbook": {
"additionalProperties": false,
"oneOf": [
@@ -163,7 +168,7 @@
},
"ignore_unreachable": {
"title": "Ignore Unreachable",
- "type": "boolean"
+ "$ref": "#/$defs/templated-boolean"
},
"module_defaults": {
"title": "Module Defaults"
@@ -348,8 +353,8 @@
"type": "boolean"
},
"gather_facts": {
- "title": "Gather Facts",
- "type": "boolean"
+ "$ref": "#/$defs/templated-boolean",
+ "title": "Gather Facts"
},
"gather_subset": {
"items": {
@@ -523,11 +528,11 @@
},
"ignore_unreachable": {
"title": "Ignore Unreachable",
- "type": "boolean"
+ "$ref": "#/$defs/templated-boolean"
},
"max_fail_percentage": {
"title": "Max Fail Percentage",
- "type": "number"
+ "$ref": "#/$defs/templated-integer"
},
"module_defaults": {
"title": "Module Defaults"
@@ -540,15 +545,23 @@
"$ref": "#/$defs/templated-boolean"
},
"order": {
- "enum": [
- "default",
- "sorted",
- "reverse_sorted",
- "reverse_inventory",
- "shuffle"
+ "oneOf": [
+ {
+ "enum": [
+ "inventory",
+ "reverse_inventory",
+ "reverse_sorted",
+ "shuffle",
+ "sorted"
+ ],
+ "type": "string"
+ },
+ {
+ "$ref": "#/$defs/full-jinja"
+ }
],
"title": "Order",
- "type": "string"
+ "markdownDescription": "See https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_strategies.html#ordering-execution-based-on-inventory"
},
"port": {
"$ref": "#/$defs/templated-integer",
@@ -720,7 +733,7 @@
},
"ignore_unreachable": {
"title": "Ignore Unreachable",
- "type": "boolean"
+ "$ref": "#/$defs/templated-boolean"
},
"module_defaults": {
"title": "Module Defaults"
@@ -831,6 +844,15 @@
"title": "Action",
"type": "string"
},
+ "ansible.builtin.include": {
+ "$ref": "#/$defs/removed-include-module"
+ },
+ "include": {
+ "$ref": "#/$defs/removed-include-module"
+ },
+ "ansible.legacy.include": {
+ "$ref": "#/$defs/removed-include-module"
+ },
"any_errors_fatal": {
"$ref": "#/$defs/templated-boolean",
"title": "Any Errors Fatal"
@@ -914,7 +936,7 @@
},
"ignore_unreachable": {
"title": "Ignore Unreachable",
- "type": "boolean"
+ "$ref": "#/$defs/templated-boolean"
},
"listen": {
"anyOf": [
@@ -1196,6 +1218,7 @@
"$id": "https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/ansible.json",
"$schema": "http://json-schema.org/draft-07/schema",
"additionalProperties": false,
+ "description": "https://docs.ansible.com/ansible/latest/reference_appendices/playbooks_keywords.html",
"examples": [],
"title": "Ansible Schemas Bundle 22.4",
"type": ["array", "object"]
diff --git a/src/ansiblelint/schemas/execution-environment.json b/src/ansiblelint/schemas/execution-environment.json
index 4720a93..7d44ab3 100644
--- a/src/ansiblelint/schemas/execution-environment.json
+++ b/src/ansiblelint/schemas/execution-environment.json
@@ -302,7 +302,8 @@
},
"$id": "https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/execution-environment.json",
"$schema": "http://json-schema.org/draft-07/schema",
- "description": "See \nV1: https://docs.ansible.com/automation-controller/latest/html/userguide/ee_reference.html\nV3: https://ansible-builder.readthedocs.io/en/latest/definition/",
+ "description": "See https://ansible-builder.readthedocs.io/en/latest/definition/ for V3 or https://docs.ansible.com/automation-controller/latest/html/userguide/ee_reference.html for older V1 format.\n",
+ "documentation_url": "https://ansible.readthedocs.io/projects/builder/en/latest/definition/",
"examples": ["execution-environment.yml"],
"oneOf": [{ "$ref": "#/$defs/v3" }, { "$ref": "#/$defs/v1" }],
"title": "Ansible Execution Environment Schema v1/v3"
diff --git a/src/ansiblelint/schemas/galaxy.json b/src/ansiblelint/schemas/galaxy.json
index 6381f28..ae03445 100644
--- a/src/ansiblelint/schemas/galaxy.json
+++ b/src/ansiblelint/schemas/galaxy.json
@@ -13,6 +13,7 @@
"description": "An enumeration.",
"enum": [
"0BSD",
+ "389-exception",
"AAL",
"ADSL",
"AFL-1.1",
@@ -26,6 +27,7 @@
"AGPL-3.0-or-later",
"AMDPLPA",
"AML",
+ "AML-glslang",
"AMPAS",
"ANTLR-PD",
"ANTLR-PD-fallback",
@@ -35,10 +37,14 @@
"APSL-1.1",
"APSL-1.2",
"APSL-2.0",
+ "ASWF-Digital-Assets-1.0",
+ "ASWF-Digital-Assets-1.1",
"Abstyles",
"AdaCore-doc",
"Adobe-2006",
+ "Adobe-Display-PostScript",
"Adobe-Glyph",
+ "Adobe-Utopia",
"Afmparse",
"Aladdin",
"Apache-1.0",
@@ -50,13 +56,21 @@
"Artistic-1.0-Perl",
"Artistic-1.0-cl8",
"Artistic-2.0",
+ "Asterisk-exception",
+ "Autoconf-exception-2.0",
+ "Autoconf-exception-3.0",
+ "Autoconf-exception-generic",
+ "Autoconf-exception-generic-3.0",
+ "Autoconf-exception-macro",
"BSD-1-Clause",
"BSD-2-Clause",
+ "BSD-2-Clause-Darwin",
"BSD-2-Clause-Patent",
"BSD-2-Clause-Views",
"BSD-3-Clause",
"BSD-3-Clause-Attribution",
"BSD-3-Clause-Clear",
+ "BSD-3-Clause-HP",
"BSD-3-Clause-LBNL",
"BSD-3-Clause-Modification",
"BSD-3-Clause-No-Military-License",
@@ -64,6 +78,9 @@
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause-No-Nuclear-Warranty",
"BSD-3-Clause-Open-MPI",
+ "BSD-3-Clause-Sun",
+ "BSD-3-Clause-acpica",
+ "BSD-3-Clause-flex",
"BSD-4-Clause",
"BSD-4-Clause-Shortened",
"BSD-4-Clause-UC",
@@ -71,20 +88,29 @@
"BSD-4.3TAHOE",
"BSD-Advertising-Acknowledgement",
"BSD-Attribution-HPND-disclaimer",
+ "BSD-Inferno-Nettverk",
"BSD-Protection",
"BSD-Source-Code",
+ "BSD-Source-beginning-file",
+ "BSD-Systemics",
+ "BSD-Systemics-W3Works",
"BSL-1.0",
"BUSL-1.1",
"Baekmuk",
"Bahyph",
"Barr",
"Beerware",
+ "Bison-exception-1.24",
+ "Bison-exception-2.2",
"BitTorrent-1.0",
"BitTorrent-1.1",
"Bitstream-Charter",
"Bitstream-Vera",
"BlueOak-1.0.0",
+ "Boehm-GC",
+ "Bootloader-exception",
"Borceux",
+ "Brian-Gladman-2-Clause",
"Brian-Gladman-3-Clause",
"C-UDA-1.0",
"CAL-1.0",
@@ -96,6 +122,7 @@
"CC-BY-2.5-AU",
"CC-BY-3.0",
"CC-BY-3.0-AT",
+ "CC-BY-3.0-AU",
"CC-BY-3.0-DE",
"CC-BY-3.0-IGO",
"CC-BY-3.0-NL",
@@ -138,6 +165,7 @@
"CC-BY-SA-3.0",
"CC-BY-SA-3.0-AT",
"CC-BY-SA-3.0-DE",
+ "CC-BY-SA-3.0-IGO",
"CC-BY-SA-4.0",
"CC-PDDC",
"CC0-1.0",
@@ -159,7 +187,9 @@
"CERN-OHL-S-2.0",
"CERN-OHL-W-2.0",
"CFITSIO",
+ "CLISP-exception-2.0",
"CMU-Mach",
+ "CMU-Mach-nodoc",
"CNRI-Jython",
"CNRI-Python",
"CNRI-Python-GPL-Compatible",
@@ -169,19 +199,26 @@
"CPOL-1.02",
"CUA-OPL-1.0",
"Caldera",
+ "Caldera-no-preamble",
"ClArtistic",
+ "Classpath-exception-2.0",
"Clips",
"Community-Spec-1.0",
"Condor-1.1",
"Cornell-Lossless-JPEG",
+ "Cronyx",
"Crossword",
"CrystalStacker",
"Cube",
"D-FSL-1.0",
+ "DEC-3-Clause",
"DL-DE-BY-2.0",
+ "DL-DE-ZERO-2.0",
"DOC",
"DRL-1.0",
+ "DRL-1.1",
"DSDP",
+ "DigiRule-FOSS-exception",
"Dotseqn",
"ECL-1.0",
"ECL-2.0",
@@ -198,16 +235,27 @@
"Entessa",
"ErlPL-1.1",
"Eurosym",
+ "FBM",
"FDK-AAC",
+ "FLTK-exception",
"FSFAP",
+ "FSFAP-no-warranty-disclaimer",
"FSFUL",
"FSFULLR",
"FSFULLRWD",
"FTL",
"Fair",
+ "Fawkes-Runtime-exception",
+ "Ferguson-Twofish",
+ "Font-exception-2.0",
"Frameworx-1.0",
"FreeBSD-DOC",
"FreeImage",
+ "Furuseth",
+ "GCC-exception-2.0",
+ "GCC-exception-2.0-note",
+ "GCC-exception-3.1",
+ "GCR-docs",
"GD",
"GFDL-1.1-invariants-only",
"GFDL-1.1-invariants-or-later",
@@ -229,20 +277,43 @@
"GFDL-1.3-or-later",
"GL2PS",
"GLWTPL",
+ "GNAT-exception",
+ "GNOME-examples-exception",
+ "GNU-compiler-exception",
"GPL-1.0-only",
"GPL-1.0-or-later",
"GPL-2.0-only",
"GPL-2.0-or-later",
+ "GPL-3.0-interface-exception",
+ "GPL-3.0-linking-exception",
+ "GPL-3.0-linking-source-exception",
"GPL-3.0-only",
"GPL-3.0-or-later",
+ "GPL-CC-1.0",
+ "GStreamer-exception-2005",
+ "GStreamer-exception-2008",
"Giftware",
"Glide",
"Glulxe",
+ "Gmsh-exception",
"Graphics-Gems",
"HP-1986",
+ "HP-1989",
"HPND",
+ "HPND-DEC",
+ "HPND-Fenneberg-Livingston",
+ "HPND-INRIA-IMAG",
+ "HPND-Kevlin-Henney",
+ "HPND-MIT-disclaimer",
"HPND-Markus-Kuhn",
+ "HPND-Pbmplus",
+ "HPND-UC",
+ "HPND-doc",
+ "HPND-doc-sell",
"HPND-export-US",
+ "HPND-export-US-modify",
+ "HPND-sell-MIT-disclaimer-xserver",
+ "HPND-sell-regexpr",
"HPND-sell-variant",
"HPND-sell-variant-MIT-disclaimer",
"HTMLTIDY",
@@ -256,9 +327,11 @@
"IPA",
"IPL-1.0",
"ISC",
+ "ISC-Veillard",
"ImageMagick",
"Imlib2",
"Info-ZIP",
+ "Inner-Net-2.0",
"Intel",
"Intel-ACPI",
"Interbase-1.0",
@@ -267,7 +340,9 @@
"JSON",
"Jam",
"JasPer-2.0",
+ "Kastrup",
"Kazlib",
+ "KiCad-libraries-exception",
"Knuth-CTAN",
"LAL-1.2",
"LAL-1.3",
@@ -275,10 +350,14 @@
"LGPL-2.0-or-later",
"LGPL-2.1-only",
"LGPL-2.1-or-later",
+ "LGPL-3.0-linking-exception",
"LGPL-3.0-only",
"LGPL-3.0-or-later",
"LGPLLR",
+ "LLGPL",
+ "LLVM-exception",
"LOOP",
+ "LPD-document",
"LPL-1.0",
"LPL-1.02",
"LPPL-1.0",
@@ -288,24 +367,36 @@
"LPPL-1.3c",
"LZMA-SDK-9.11-to-9.20",
"LZMA-SDK-9.22",
+ "LZMA-exception",
"Latex2e",
+ "Latex2e-translated-notice",
"Leptonica",
"LiLiQ-P-1.1",
"LiLiQ-R-1.1",
"LiLiQ-Rplus-1.1",
"Libpng",
+ "Libtool-exception",
"Linux-OpenIB",
+ "Linux-man-pages-1-para",
"Linux-man-pages-copyleft",
+ "Linux-man-pages-copyleft-2-para",
+ "Linux-man-pages-copyleft-var",
+ "Linux-syscall-note",
+ "Lucida-Bitmap-Fonts",
"MIT",
"MIT-0",
"MIT-CMU",
+ "MIT-Festival",
"MIT-Modern-Variant",
"MIT-Wu",
"MIT-advertising",
"MIT-enna",
"MIT-feh",
"MIT-open-group",
+ "MIT-testregex",
"MITNFA",
+ "MMIXware",
+ "MPEG-SSG",
"MPL-1.0",
"MPL-1.1",
"MPL-2.0",
@@ -314,8 +405,11 @@
"MS-PL",
"MS-RL",
"MTLL",
+ "Mackerras-3-Clause",
+ "Mackerras-3-Clause-acknowledgment",
"MakeIndex",
"Martin-Birgmeier",
+ "McPhee-slideshow",
"Minpack",
"MirOS",
"Motosoto",
@@ -332,6 +426,7 @@
"NICTA-1.0",
"NIST-PD",
"NIST-PD-fallback",
+ "NIST-Software",
"NLOD-1.0",
"NLOD-2.0",
"NLPL",
@@ -350,7 +445,9 @@
"Noweb",
"O-UDA-1.0",
"OCCT-PL",
+ "OCCT-exception-1.0",
"OCLC-2.0",
+ "OCaml-LGPL-linking-exception",
"ODC-By-1.0",
"ODbL-1.0",
"OFFIS",
@@ -383,8 +480,10 @@
"OLDAP-2.6",
"OLDAP-2.7",
"OLDAP-2.8",
+ "OLFL-1.3",
"OML",
"OPL-1.0",
+ "OPL-UK-3.0",
"OPUBL-1.0",
"OSET-PL-2.1",
"OSL-1.0",
@@ -392,14 +491,20 @@
"OSL-2.0",
"OSL-2.1",
"OSL-3.0",
+ "OpenJDK-assembly-exception-1.0",
"OpenPBS-2.3",
"OpenSSL",
+ "OpenSSL-standalone",
+ "OpenVision",
+ "PADL",
"PDDL-1.0",
"PHP-3.0",
"PHP-3.01",
+ "PS-or-PDF-font-exception-20170817",
"PSF-2.0",
"Parity-6.0.0",
"Parity-7.0.0",
+ "Pixar",
"Plexus",
"PolyForm-Noncommercial-1.0.0",
"PolyForm-Small-Business-1.0.0",
@@ -408,7 +513,11 @@
"Python-2.0.1",
"QPL-1.0",
"QPL-1.0-INRIA-2004",
+ "QPL-1.0-INRIA-2004-exception",
"Qhull",
+ "Qt-GPL-exception-1.0",
+ "Qt-LGPL-exception-1.1",
+ "Qwt-exception-1.0",
"RHeCos-1.1",
"RPL-1.1",
"RPL-1.5",
@@ -417,22 +526,31 @@
"RSCPL",
"Rdisc",
"Ruby",
+ "SANE-exception",
"SAX-PD",
+ "SAX-PD-2.0",
"SCEA",
"SGI-B-1.0",
"SGI-B-1.1",
"SGI-B-2.0",
+ "SGI-OpenGL",
+ "SGP4",
"SHL-0.5",
"SHL-0.51",
+ "SHL-2.0",
+ "SHL-2.1",
"SISSL",
"SISSL-1.2",
+ "SL",
"SMLNJ",
"SMPPL",
"SNIA",
"SPL-1.0",
"SSH-OpenSSH",
"SSH-short",
+ "SSLeay-standalone",
"SSPL-1.0",
+ "SWI-exception",
"SWL",
"Saxpath",
"SchemeReport",
@@ -440,29 +558,42 @@
"Sendmail-8.23",
"SimPL-2.0",
"Sleepycat",
+ "Soundex",
"Spencer-86",
"Spencer-94",
"Spencer-99",
"SugarCRM-1.1.3",
+ "Sun-PPP",
"SunPro",
+ "Swift-exception",
"Symlinks",
"TAPR-OHL-1.0",
"TCL",
"TCP-wrappers",
+ "TGPPL-1.0",
"TMate",
"TORQUE-1.1",
"TOSL",
"TPDL",
"TPL-1.0",
"TTWL",
+ "TTYP0",
"TU-Berlin-1.0",
"TU-Berlin-2.0",
+ "TermReadKey",
+ "Texinfo-exception",
+ "UBDL-exception",
"UCAR",
"UCL-1.0",
+ "UMich-Merit",
"UPL-1.0",
+ "URT-RLE",
+ "Unicode-3.0",
"Unicode-DFS-2015",
"Unicode-DFS-2016",
"Unicode-TOU",
+ "Universal-FOSS-exception-1.0",
+ "UnixCrypt",
"Unlicense",
"VOSTROM",
"VSL-1.0",
@@ -472,12 +603,16 @@
"W3C-20150513",
"WTFPL",
"Watcom-1.0",
+ "Widget-Workshop",
"Wsuipa",
+ "WxWindows-exception-3.1",
"X11",
"X11-distribute-modifications-variant",
"XFree86-1.1",
"XSkat",
+ "Xdebug-1.03",
"Xerox",
+ "Xfig",
"Xnet",
"YPL-1.0",
"YPL-1.1",
@@ -485,35 +620,67 @@
"ZPL-2.0",
"ZPL-2.1",
"Zed",
+ "Zeeff",
"Zend-2.0",
"Zimbra-1.3",
"Zimbra-1.4",
"Zlib",
+ "bcrypt-Solar-Designer",
"blessing",
"bzip2-1.0.6",
+ "check-cvs",
"checkmk",
"copyleft-next-0.3.0",
"copyleft-next-0.3.1",
+ "cryptsetup-OpenSSL-exception",
"curl",
"diffmark",
+ "dtoa",
"dvipdfm",
+ "eCos-exception-2.0",
"eGenix",
"etalab-2.0",
+ "fmt-exception",
+ "freertos-exception-2.0",
+ "fwlw",
"gSOAP-1.3b",
+ "gnu-javamail-exception",
"gnuplot",
+ "gtkbook",
+ "hdparm",
+ "i2p-gpl-java-exception",
"iMatix",
"libpng-2.0",
+ "libpri-OpenH323-exception",
"libselinux-1.0",
"libtiff",
"libutil-David-Nugent",
+ "lsof",
+ "magaz",
+ "mailprio",
+ "metamail",
+ "mif-exception",
"mpi-permissive",
"mpich2",
"mplus",
+ "openvpn-openssl-exception",
+ "pnmstitch",
"psfrag",
"psutils",
+ "python-ldap",
+ "radvd",
"snprintf",
+ "softSurfer",
+ "ssh-keyscan",
+ "stunnel-exception",
+ "swrule",
+ "u-boot-exception-2.0",
+ "ulem",
+ "vsftpd-openssl-exception",
"w3m",
+ "x11vnc-openssl-exception",
"xinetd",
+ "xkeyboard-config-Zinoviev",
"xlock",
"xpp",
"zlib-acknowledgement"
@@ -525,6 +692,7 @@
"$schema": "http://json-schema.org/draft-07/schema",
"additionalProperties": false,
"examples": ["galaxy.yml"],
+ "markdownDescription": "https://docs.ansible.com/ansible/latest/dev_guide/collections_galaxy_meta.html",
"properties": {
"authors": {
"items": {
diff --git a/src/ansiblelint/schemas/inventory.json b/src/ansiblelint/schemas/inventory.json
index 80333ce..06cf2ca 100644
--- a/src/ansiblelint/schemas/inventory.json
+++ b/src/ansiblelint/schemas/inventory.json
@@ -45,7 +45,7 @@
"$id": "https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/inventory.json",
"$schema": "http://json-schema.org/draft-07/schema",
"additionalProperties": true,
- "description": "Ansible Inventory Schema",
+ "description": "See https://docs.ansible.com/ansible/latest/inventory_guide/intro_inventory.html",
"examples": [
"inventory.yaml",
"inventory.yml",
diff --git a/src/ansiblelint/schemas/main.py b/src/ansiblelint/schemas/main.py
index 590aea3..45b0c48 100644
--- a/src/ansiblelint/schemas/main.py
+++ b/src/ansiblelint/schemas/main.py
@@ -1,8 +1,11 @@
"""Module containing cached JSON schemas."""
+
from __future__ import annotations
import json
import logging
+import re
+import typing
from typing import TYPE_CHECKING
import jsonschema
@@ -18,20 +21,95 @@ if TYPE_CHECKING:
from ansiblelint.file_utils import Lintable
+def find_best_deep_match(
+ errors: jsonschema.ValidationError,
+) -> jsonschema.ValidationError:
+ """Return the deepest schema validation error."""
+
+ def iter_validation_error(
+ err: jsonschema.ValidationError,
+ ) -> typing.Iterator[jsonschema.ValidationError]:
+ if err.context:
+ for e in err.context:
+ yield e
+ yield from iter_validation_error(e)
+
+ return max(iter_validation_error(errors), key=_deep_match_relevance)
+
+
def validate_file_schema(file: Lintable) -> list[str]:
"""Return list of JSON validation errors found."""
+ schema = {}
if file.kind not in JSON_SCHEMAS:
return [f"Unable to find JSON Schema '{file.kind}' for '{file.path}' file."]
try:
# convert yaml to json (keys are converted to strings)
yaml_data = yaml_load_safe(file.content)
json_data = json.loads(json.dumps(yaml_data))
- jsonschema.validate(
- instance=json_data,
- schema=_schema_cache[file.kind],
- )
+ schema = _schema_cache[file.kind]
+
+ validator = jsonschema.validators.validator_for(schema)
+ v = validator(schema)
+ try:
+ error = next(v.iter_errors(json_data))
+ except StopIteration:
+ return []
+ if error.context:
+ error = find_best_deep_match(error)
+ # determine if we want to use our own messages embedded into schemas inside title/markdownDescription fields
+ if "not" in error.schema and len(error.schema["not"]) == 0:
+ message = error.schema["title"]
+ schema = error.schema
+ else:
+ message = f"{error.json_path} {error.message}"
+
+ documentation_url = ""
+ for json_schema in (error.schema, schema):
+ for k in ("description", "markdownDescription"):
+ if k in json_schema:
+ # Find standalone URLs and also markdown urls.
+ match = re.search(
+ r"\[.*?\]\((?P<url>https?://[^\s]+)\)|(?P<url2>https?://[^\s]+)",
+ json_schema[k],
+ )
+ if match:
+ documentation_url = next(
+ x for x in match.groups() if x is not None
+ )
+ break
+ if documentation_url:
+ break
+ if documentation_url:
+ if not message.endswith("."):
+ message += "."
+ message += f" See {documentation_url}"
except yaml.constructor.ConstructorError as exc:
return [f"Failed to load YAML file '{file.path}': {exc.problem}"]
except ValidationError as exc:
- return [exc.message]
- return []
+ message = exc.message
+ documentation_url = ""
+ for k in ("description", "markdownDescription"):
+ if k in schema:
+ # Find standalone URLs and also markdown urls.
+ match = re.search(
+ r"\[.*?\]\((https?://[^\s]+)\)|https?://[^\s]+",
+ schema[k],
+ )
+ if match:
+ documentation_url = match.groups()[0]
+ break
+ if documentation_url:
+ if not message.endswith("."):
+ message += "."
+ message += f" See {documentation_url}"
+ return [message]
+ return [message]
+
+
+def _deep_match_relevance(error: jsonschema.ValidationError) -> tuple[bool | int, ...]:
+ validator = error.validator
+ return (
+ validator not in ("anyOf", "oneOf"), # type: ignore[comparison-overlap]
+ len(error.absolute_path),
+ -len(error.path),
+ )
diff --git a/src/ansiblelint/schemas/meta.json b/src/ansiblelint/schemas/meta.json
index 384d113..8971817 100644
--- a/src/ansiblelint/schemas/meta.json
+++ b/src/ansiblelint/schemas/meta.json
@@ -110,6 +110,25 @@
"title": "ArchLinuxPlatformModel",
"type": "object"
},
+ "AstraLinuxPlatformModel": {
+ "properties": {
+ "name": {
+ "const": "Astra Linux",
+ "title": "Name",
+ "type": "string"
+ },
+ "versions": {
+ "default": "all",
+ "items": {
+ "enum": ["1.8", "1.7", "1.6", "2.12", "all"],
+ "type": "string"
+ },
+ "type": "array"
+ }
+ },
+ "title": "AstraLinuxPlatformModel",
+ "type": "object"
+ },
"ClearLinuxPlatformModel": {
"properties": {
"name": {
@@ -168,6 +187,7 @@
"sid",
"squeeze",
"stretch",
+ "trixie",
"wheezy",
"all"
],
@@ -267,7 +287,14 @@
"versions": {
"default": "all",
"items": {
- "enum": ["ascii", "beowulf", "ceres", "jessie", "all"],
+ "enum": [
+ "ascii",
+ "beowulf",
+ "chimaera",
+ "daedalus",
+ "jessie",
+ "all"
+ ],
"type": "string"
},
"type": "array"
@@ -286,7 +313,7 @@
"versions": {
"default": "all",
"items": {
- "enum": ["5.2", "5.4", "all"],
+ "enum": ["5.2", "5.4", "5.6", "5.8", "6.0", "6.2", "6.4", "all"],
"type": "string"
},
"type": "array"
@@ -348,6 +375,8 @@
"36",
"37",
"38",
+ "39",
+ "40",
"all"
],
"type": "string"
@@ -503,7 +532,7 @@
"namespace": {
"markdownDescription": "Used by molecule and ansible-lint to compute FQRN for roles outside collections",
"minLength": 2,
- "pattern": "^[a-z][a-z0-9_]+$",
+ "pattern": "^[a-z][a-z0-9_-]+$",
"title": "Namespace Name",
"type": "string"
},
@@ -838,7 +867,15 @@
"versions": {
"default": "all",
"items": {
- "enum": ["17.01", "18.06", "19.07", "21.02", "22.03", "all"],
+ "enum": [
+ "17.01",
+ "18.06",
+ "19.07",
+ "21.02",
+ "22.03",
+ "23.05",
+ "all"
+ ],
"type": "string"
},
"type": "array"
@@ -879,6 +916,7 @@
"8.8",
"9.0",
"9.1",
+ "9.2",
"all"
],
"type": "string"
@@ -908,6 +946,39 @@
"title": "PAN-OSPlatformModel",
"type": "object"
},
+ "RockyLinuxPlatformModel": {
+ "properties": {
+ "name": {
+ "const": "Rocky",
+ "title": "Name",
+ "type": "string"
+ },
+ "versions": {
+ "default": "all",
+ "items": {
+ "enum": [
+ "8.0",
+ "8.1",
+ "8.2",
+ "8.3",
+ "8.4",
+ "8.5",
+ "8.6",
+ "8.7",
+ "8.8",
+ "9.0",
+ "9.1",
+ "9.2",
+ "all"
+ ],
+ "type": "string"
+ },
+ "type": "array"
+ }
+ },
+ "title": "RockyLinuxPlatformModel",
+ "type": "object"
+ },
"SLESPlatformModel": {
"properties": {
"name": {
@@ -1038,7 +1109,6 @@
"artful",
"bionic",
"cosmic",
- "cuttlefish",
"disco",
"eoan",
"focal",
@@ -1046,7 +1116,11 @@
"hirsute",
"impish",
"jammy",
+ "kinetic",
"lucid",
+ "lunar",
+ "mantic",
+ "noble",
"maverick",
"natty",
"oneiric",
@@ -1199,6 +1273,8 @@
"Mojave",
"Monterey",
"Sierra",
+ "Sonoma",
+ "Ventura",
"all"
],
"type": "string"
@@ -1372,6 +1448,9 @@
"$ref": "#/$defs/PAN-OSPlatformModel"
},
{
+ "$ref": "#/$defs/RockyLinuxPlatformModel"
+ },
+ {
"$ref": "#/$defs/SLESPlatformModel"
},
{
@@ -1447,6 +1526,7 @@
},
"$id": "https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/meta.json",
"$schema": "http://json-schema.org/draft-07/schema",
+ "description": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_reuse_roles.html#using-role-dependencies",
"examples": ["meta/main.yml"],
"properties": {
"additionalProperties": false,
@@ -1459,7 +1539,14 @@
},
"dependencies": {
"items": {
- "$ref": "#/$defs/DependencyModel"
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "$ref": "#/$defs/DependencyModel"
+ }
+ ]
},
"title": "Dependencies",
"type": "array"
diff --git a/src/ansiblelint/schemas/molecule.json b/src/ansiblelint/schemas/molecule.json
index d957f08..21f1610 100644
--- a/src/ansiblelint/schemas/molecule.json
+++ b/src/ansiblelint/schemas/molecule.json
@@ -512,6 +512,7 @@
"$id": "https://raw.githubusercontent.com/ansible/ansible-lint/main/src/ansiblelint/schemas/molecule.json",
"$schema": "http://json-schema.org/draft-07/schema",
"additionalProperties": false,
+ "description": "https://ansible.readthedocs.io/projects/molecule/configuration/",
"examples": ["molecule/*/molecule.yml"],
"properties": {
"dependency": {
diff --git a/src/ansiblelint/schemas/playbook.json b/src/ansiblelint/schemas/playbook.json
index 983033f..f4d315b 100644
--- a/src/ansiblelint/schemas/playbook.json
+++ b/src/ansiblelint/schemas/playbook.json
@@ -171,8 +171,8 @@
"$ref": "#/$defs/ignore_errors"
},
"ignore_unreachable": {
- "title": "Ignore Unreachable",
- "type": "boolean"
+ "$ref": "#/$defs/templated-boolean",
+ "title": "Ignore Unreachable"
},
"module_defaults": {
"title": "Module Defaults"
@@ -363,8 +363,8 @@
"type": "boolean"
},
"gather_facts": {
- "title": "Gather Facts",
- "type": "boolean"
+ "$ref": "#/$defs/templated-boolean",
+ "title": "Gather Facts"
},
"gather_subset": {
"items": {
@@ -537,12 +537,12 @@
"$ref": "#/$defs/ignore_errors"
},
"ignore_unreachable": {
- "title": "Ignore Unreachable",
- "type": "boolean"
+ "$ref": "#/$defs/templated-boolean",
+ "title": "Ignore Unreachable"
},
"max_fail_percentage": {
- "title": "Max Fail Percentage",
- "type": "number"
+ "$ref": "#/$defs/templated-integer",
+ "title": "Max Fail Percentage"
},
"module_defaults": {
"title": "Module Defaults"
@@ -555,15 +555,23 @@
"$ref": "#/$defs/templated-boolean"
},
"order": {
- "enum": [
- "default",
- "sorted",
- "reverse_sorted",
- "reverse_inventory",
- "shuffle"
+ "markdownDescription": "See https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_strategies.html#ordering-execution-based-on-inventory",
+ "oneOf": [
+ {
+ "enum": [
+ "inventory",
+ "reverse_inventory",
+ "reverse_sorted",
+ "shuffle",
+ "sorted"
+ ],
+ "type": "string"
+ },
+ {
+ "$ref": "#/$defs/full-jinja"
+ }
],
- "title": "Order",
- "type": "string"
+ "title": "Order"
},
"port": {
"$ref": "#/$defs/templated-integer",
@@ -740,8 +748,8 @@
"$ref": "#/$defs/ignore_errors"
},
"ignore_unreachable": {
- "title": "Ignore Unreachable",
- "type": "boolean"
+ "$ref": "#/$defs/templated-boolean",
+ "title": "Ignore Unreachable"
},
"module_defaults": {
"title": "Module Defaults"
@@ -796,6 +804,11 @@
"title": "play-role",
"type": "object"
},
+ "removed-include-module": {
+ "markdownDescription": "See [include module](https://docs.ansible.com/ansible/latest/collections/ansible/builtin/include_module.html)",
+ "not": {},
+ "title": "Replace 'include' with either 'ansible.builtin.include_tasks' or 'ansible.builtin.import_tasks'"
+ },
"tags": {
"anyOf": [
{
@@ -847,6 +860,12 @@
"title": "Action",
"type": "string"
},
+ "ansible.builtin.include": {
+ "$ref": "#/$defs/removed-include-module"
+ },
+ "ansible.legacy.include": {
+ "$ref": "#/$defs/removed-include-module"
+ },
"any_errors_fatal": {
"$ref": "#/$defs/templated-boolean",
"title": "Any Errors Fatal"
@@ -929,8 +948,11 @@
"$ref": "#/$defs/ignore_errors"
},
"ignore_unreachable": {
- "title": "Ignore Unreachable",
- "type": "boolean"
+ "$ref": "#/$defs/templated-boolean",
+ "title": "Ignore Unreachable"
+ },
+ "include": {
+ "$ref": "#/$defs/removed-include-module"
},
"listen": {
"anyOf": [
diff --git a/src/ansiblelint/schemas/requirements.json b/src/ansiblelint/schemas/requirements.json
index dc7ded6..ef8d2a4 100644
--- a/src/ansiblelint/schemas/requirements.json
+++ b/src/ansiblelint/schemas/requirements.json
@@ -130,6 +130,7 @@
"$ref": "#/$defs/RequirementsV2Model"
}
],
+ "description": "https://docs.ansible.com/ansible/latest/galaxy/user_guide.html#installing-roles-and-collections-from-the-same-requirements-yml-file",
"examples": ["requirements.yml"],
"title": "Ansible Requirements Schema"
}
diff --git a/src/ansiblelint/schemas/role-arg-spec.json b/src/ansiblelint/schemas/role-arg-spec.json
index 433993e..111fbe5 100644
--- a/src/ansiblelint/schemas/role-arg-spec.json
+++ b/src/ansiblelint/schemas/role-arg-spec.json
@@ -1,5 +1,73 @@
{
"$defs": {
+ "attribute": {
+ "additionalProperties": false,
+ "properties": {
+ "description": {
+ "description": "Detailed explanation of what this attribute does. It should be written in full sentences.",
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ }
+ ]
+ },
+ "details": {
+ "description": "Detailed explanation of what this attribute does. It should be written in full sentences.",
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ }
+ ]
+ },
+ "membership": {
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ }
+ ]
+ },
+ "platform": {
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "items": {
+ "type": "string"
+ },
+ "type": "array"
+ }
+ ]
+ },
+ "support": {
+ "enum": ["full", "partial", "none", "N/A"],
+ "type": "string"
+ },
+ "version_added": {
+ "type": "string"
+ }
+ },
+ "required": ["description", "support"],
+ "title": "Attribute"
+ },
"datatype": {
"enum": [
"str",
@@ -38,6 +106,12 @@
"entry_point": {
"additionalProperties": false,
"properties": {
+ "attributes": {
+ "additionalProperties": {
+ "$ref": "#/$defs/attribute"
+ },
+ "type": "object"
+ },
"author": {
"oneOf": [
{
@@ -64,6 +138,9 @@
}
]
},
+ "examples": {
+ "type": "string"
+ },
"options": {
"additionalProperties": {
"$ref": "#/$defs/option"
@@ -146,30 +223,27 @@
"title": "Entry Point",
"type": "object"
},
+ "full-jinja": {
+ "pattern": "^\\{[\\{%](.|[\r\n])*[\\}%]\\}$",
+ "type": "string"
+ },
"option": {
"additionalProperties": false,
- "aliases": {
- "items": {
+ "markdownDescription": "See [argument-spec](https://docs.ansible.com/ansible/latest/dev_guide/developing_program_flow_modules.html#argument-spec)",
+ "properties": {
+ "apply_defaults": {
"type": "string"
},
- "type": "array"
- },
- "apply_defaults": {
- "type": "string"
- },
- "deprecated_aliases": {
- "items": {
- "$ref": "#/$defs/deprecated_alias"
- },
- "type": "array"
- },
- "markdownDescription": "xxx",
- "options": {
- "$ref": "#/$defs/option"
- },
- "properties": {
"choices": {
- "type": "array"
+ "oneOf": [
+ {
+ "type": "array"
+ },
+ {
+ "$ref": "#/$defs/full-jinja",
+ "type": "string"
+ }
+ ]
},
"default": {
"default": "None"
@@ -213,6 +287,70 @@
"default": false,
"type": "boolean"
},
+ "mutually_exclusive": {
+ "type": "array",
+ "items": {
+ "items": {
+ "type": "string"
+ }
+ }
+ },
+ "required_together": {
+ "type": "array",
+ "items": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ },
+ "required_one_of": {
+ "type": "array",
+ "items": {
+ "items": {
+ "type": "string"
+ }
+ }
+ },
+ "required_if": {
+ "type": "array",
+ "items": {
+ "type": "array",
+ "prefixItems": [
+ {
+ "type": "string"
+ },
+ {},
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "boolean"
+ }
+ ],
+ "minItems": 3,
+ "maxItems": 4
+ }
+ },
+ "required_by": {
+ "type": "object",
+ "additionalProperties": {
+ "oneOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ ]
+ }
+ },
"type": {
"$ref": "#/$defs/datatype",
"markdownDescription": "See [argument-spec](https://docs.ansible.com/ansible/latest/dev_guide/developing_program_flow_modules.html#argument-spec"
@@ -237,7 +375,7 @@
"$schema": "http://json-schema.org/draft-07/schema",
"additionalProperties": false,
"examples": ["meta/argument_specs.yml"],
- "markdownDescription": "Add entry point, usually `main`.\nSee [role-argument-validation](https://docs.ansible.com/ansible/latest/user_guide/playbooks_reuse_roles.html#role-argument-validation)",
+ "markdownDescription": "See [role-argument-validation](https://docs.ansible.com/ansible/latest/user_guide/playbooks_reuse_roles.html#role-argument-validation)",
"properties": {
"argument_specs": {
"additionalProperties": {
diff --git a/src/ansiblelint/schemas/rulebook.json b/src/ansiblelint/schemas/rulebook.json
index 6c441cd..6321f08 100644
--- a/src/ansiblelint/schemas/rulebook.json
+++ b/src/ansiblelint/schemas/rulebook.json
@@ -1,6 +1,8 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://raw.githubusercontent.com/ansible/ansible-rulebook/main/ansible_rulebook/schema/ruleset_schema.json",
+ "title": "Ansible Rulebook",
+ "description": "See https://ansible.readthedocs.io/projects/rulebook/en/stable/rulebooks.html",
"type": "array",
"items": {
"$ref": "#/$defs/ruleset"
@@ -25,12 +27,19 @@
"type": "boolean",
"default": false
},
+ "match_multiple_rules": {
+ "type": "boolean",
+ "default": false
+ },
"name": {
"type": "string"
},
"execution_strategy": {
"type": "string",
- "enum": ["sequential", "parallel"],
+ "enum": [
+ "parallel",
+ "sequential"
+ ],
"default": "sequential"
},
"sources": {
@@ -47,6 +56,7 @@
}
},
"required": [
+ "name",
"hosts",
"sources",
"rules"
@@ -147,6 +157,9 @@
"type": "string"
},
{
+ "type": "boolean"
+ },
+ {
"$ref": "#/$defs/all-condition"
},
{
@@ -171,6 +184,9 @@
"$ref": "#/$defs/run-job-template-action"
},
{
+ "$ref": "#/$defs/run-workflow-template-action"
+ },
+ {
"$ref": "#/$defs/post-event-action"
},
{
@@ -190,6 +206,9 @@
},
{
"$ref": "#/$defs/shutdown-action"
+ },
+ {
+ "$ref": "#/$defs/pg-notify-action"
}
]
}
@@ -206,6 +225,9 @@
"$ref": "#/$defs/run-job-template-action"
},
{
+ "$ref": "#/$defs/run-workflow-template-action"
+ },
+ {
"$ref": "#/$defs/post-event-action"
},
{
@@ -225,6 +247,9 @@
},
{
"$ref": "#/$defs/shutdown-action"
+ },
+ {
+ "$ref": "#/$defs/pg-notify-action"
}
]
}
@@ -342,9 +367,6 @@
"run_module": {
"type": "object",
"properties": {
- "copy_files": {
- "type": "boolean"
- },
"name": {
"type": "string"
},
@@ -376,7 +398,10 @@
"type": "number"
},
"module_args": {
- "type": "object"
+ "type": [
+ "object",
+ "string"
+ ]
},
"extra_vars": {
"type": "object"
@@ -442,6 +467,91 @@
],
"additionalProperties": false
},
+ "run-workflow-template-action": {
+ "type": "object",
+ "properties": {
+ "run_workflow_template": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "organization": {
+ "type": "string"
+ },
+ "job_args": {
+ "type": "object"
+ },
+ "post_events": {
+ "type": "boolean"
+ },
+ "set_facts": {
+ "type": "boolean"
+ },
+ "ruleset": {
+ "type": "string"
+ },
+ "var_root": {
+ "type": "string"
+ },
+ "retry": {
+ "type": "boolean"
+ },
+ "retries": {
+ "type": "integer"
+ },
+ "delay": {
+ "type": "integer"
+ }
+ },
+ "required": [
+ "name",
+ "organization"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "run_workflow_template"
+ ],
+ "additionalProperties": false
+ },
+ "pg-notify-action": {
+ "type": "object",
+ "properties": {
+ "pg_notify": {
+ "type": "object",
+ "properties": {
+ "dsn": {
+ "type": "string"
+ },
+ "channel": {
+ "type": "string"
+ },
+ "event": {
+ "type": [
+ "string",
+ "object"
+ ]
+ },
+ "remove_meta": {
+ "type": "boolean",
+ "default": false
+ }
+ },
+ "required": [
+ "dsn",
+ "channel",
+ "event"
+ ],
+ "additionalProperties": false
+ }
+ },
+ "required": [
+ "pg_notify"
+ ],
+ "additionalProperties": false
+ },
"post-event-action": {
"type": "object",
"properties": {
diff --git a/src/ansiblelint/schemas/tasks.json b/src/ansiblelint/schemas/tasks.json
index ec7f85d..d6efec8 100644
--- a/src/ansiblelint/schemas/tasks.json
+++ b/src/ansiblelint/schemas/tasks.json
@@ -123,8 +123,8 @@
"$ref": "#/$defs/ignore_errors"
},
"ignore_unreachable": {
- "title": "Ignore Unreachable",
- "type": "boolean"
+ "$ref": "#/$defs/templated-boolean",
+ "title": "Ignore Unreachable"
},
"module_defaults": {
"title": "Module Defaults"
@@ -238,6 +238,11 @@
"markdownDescription": "Use for protecting sensitive data. See [no_log](https://docs.ansible.com/ansible/latest/reference_appendices/logging.html)",
"title": "no_log"
},
+ "removed-include-module": {
+ "markdownDescription": "See [include module](https://docs.ansible.com/ansible/latest/collections/ansible/builtin/include_module.html)",
+ "not": {},
+ "title": "Replace 'include' with either 'ansible.builtin.include_tasks' or 'ansible.builtin.import_tasks'"
+ },
"tags": {
"anyOf": [
{
@@ -289,6 +294,12 @@
"title": "Action",
"type": "string"
},
+ "ansible.builtin.include": {
+ "$ref": "#/$defs/removed-include-module"
+ },
+ "ansible.legacy.include": {
+ "$ref": "#/$defs/removed-include-module"
+ },
"any_errors_fatal": {
"$ref": "#/$defs/templated-boolean",
"title": "Any Errors Fatal"
@@ -371,8 +382,11 @@
"$ref": "#/$defs/ignore_errors"
},
"ignore_unreachable": {
- "title": "Ignore Unreachable",
- "type": "boolean"
+ "$ref": "#/$defs/templated-boolean",
+ "title": "Ignore Unreachable"
+ },
+ "include": {
+ "$ref": "#/$defs/removed-include-module"
},
"listen": {
"anyOf": [
diff --git a/src/ansiblelint/schemas/vars.json b/src/ansiblelint/schemas/vars.json
index c0b66e8..44acb10 100644
--- a/src/ansiblelint/schemas/vars.json
+++ b/src/ansiblelint/schemas/vars.json
@@ -17,6 +17,7 @@
"type": "null"
}
],
+ "description": "https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_variables.html",
"examples": [
"playbooks/vars/*.yml",
"vars/*.yml",