From 17194e6250879d3045384bf4a150fbc6e0b9c397 Mon Sep 17 00:00:00 2001 From: Conner Crosby Date: Wed, 24 Apr 2024 10:25:35 -0400 Subject: [PATCH] Allow jinja2 expression for choices field (#4043) (#4117) --- src/ansiblelint/schemas/role-arg-spec.json | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/ansiblelint/schemas/role-arg-spec.json b/src/ansiblelint/schemas/role-arg-spec.json index fcb78a7fdf..fc0fb5a865 100644 --- a/src/ansiblelint/schemas/role-arg-spec.json +++ b/src/ansiblelint/schemas/role-arg-spec.json @@ -220,6 +220,10 @@ "title": "Entry Point", "type": "object" }, + "full-jinja": { + "pattern": "^\\{[\\{%](.|[\r\n])*[\\}%]\\}$", + "type": "string" + }, "option": { "additionalProperties": false, "markdownDescription": "See [argument-spec](https://docs.ansible.com/ansible/latest/dev_guide/developing_program_flow_modules.html#argument-spec)", @@ -228,7 +232,15 @@ "type": "string" }, "choices": { - "type": "array" + "oneOf": [ + { + "type": "array" + }, + { + "$ref": "#/$defs/full-jinja", + "type": "string" + } + ] }, "default": { "default": "None"