Skip to content
This repository was archived by the owner on Dec 2, 2022. It is now read-only.

Commit 8f03b43

Browse files
authored
Allow use of when with meta/main.yml (#306)
1 parent 34f2a38 commit 8f03b43

File tree

3 files changed

+29
-6
lines changed

3 files changed

+29
-6
lines changed

f/ansible-meta.json

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,8 @@
250250
"type": "string"
251251
},
252252
"when": {
253-
"title": "When",
254-
"type": "string"
253+
"$ref": "#/$defs/complex_conditional",
254+
"title": "When"
255255
}
256256
},
257257
"title": "Dependency entry",
@@ -1098,6 +1098,22 @@
10981098
"title": "aosPlatformModel",
10991099
"type": "object"
11001100
},
1101+
"complex_conditional": {
1102+
"oneOf": [
1103+
{
1104+
"type": "boolean"
1105+
},
1106+
{
1107+
"type": "string"
1108+
},
1109+
{
1110+
"items": {
1111+
"type": "string"
1112+
},
1113+
"type": "array"
1114+
}
1115+
]
1116+
},
11011117
"eosPlatformModel": {
11021118
"properties": {
11031119
"name": {

negative_test/roles/role_with_bad_deps_in_meta/meta/main.yml.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"params": {
1919
"missingProperty": "role"
2020
},
21-
"schemaPath": "#/$defs/DependencyModel/anyOf/0/required"
21+
"schemaPath": "#/anyOf/0/required"
2222
},
2323
{
2424
"instancePath": "/dependencies/0",
@@ -27,7 +27,7 @@
2727
"params": {
2828
"missingProperty": "src"
2929
},
30-
"schemaPath": "#/$defs/DependencyModel/anyOf/1/required"
30+
"schemaPath": "#/anyOf/1/required"
3131
},
3232
{
3333
"instancePath": "/dependencies/0",
@@ -36,14 +36,14 @@
3636
"params": {
3737
"missingProperty": "name"
3838
},
39-
"schemaPath": "#/$defs/DependencyModel/anyOf/2/required"
39+
"schemaPath": "#/anyOf/2/required"
4040
},
4141
{
4242
"instancePath": "/dependencies/0",
4343
"keyword": "anyOf",
4444
"message": "must match a schema in anyOf",
4545
"params": {},
46-
"schemaPath": "#/$defs/DependencyModel/anyOf"
46+
"schemaPath": "#/anyOf"
4747
},
4848
{
4949
"instancePath": "",

test/roles/maximum/meta/main.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
allow_duplicates: true
12
galaxy_info:
23
description: maximum
34
min_ansible_version: "2.9"
@@ -9,3 +10,9 @@ galaxy_info:
910
- name: Alpine
1011
versions:
1112
- all
13+
dependencies:
14+
- role: foo
15+
vars: {}
16+
when:
17+
- foo
18+
- bar

0 commit comments

Comments
 (0)