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

Allow retries, poll and port to be templated integers #290

Merged
merged 1 commit into from
May 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions f/ansible-playbook.json
Original file line number Diff line number Diff line change
Expand Up @@ -797,12 +797,12 @@
"title": "Notify"
},
"poll": {
"title": "Poll",
"type": "integer"
"$ref": "#/$defs/templated-integer",
"title": "Poll"
},
"port": {
"title": "Port",
"type": "integer"
"$ref": "#/$defs/templated-integer",
"title": "Port"
},
"register": {
"title": "Register",
Expand All @@ -813,8 +813,8 @@
"type": "string"
},
"retries": {
"title": "Retries",
"type": "integer"
"$ref": "#/$defs/templated-integer",
"title": "Retries"
},
"run_once": {
"$ref": "#/$defs/templated-boolean",
Expand Down
12 changes: 6 additions & 6 deletions f/ansible-tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -374,12 +374,12 @@
"title": "Notify"
},
"poll": {
"title": "Poll",
"type": "integer"
"$ref": "#/$defs/templated-integer",
"title": "Poll"
},
"port": {
"title": "Port",
"type": "integer"
"$ref": "#/$defs/templated-integer",
"title": "Port"
},
"register": {
"title": "Register",
Expand All @@ -390,8 +390,8 @@
"type": "string"
},
"retries": {
"title": "Retries",
"type": "integer"
"$ref": "#/$defs/templated-integer",
"title": "Retries"
},
"run_once": {
"$ref": "#/$defs/templated-boolean",
Expand Down
12 changes: 6 additions & 6 deletions f/ansible.json
Original file line number Diff line number Diff line change
Expand Up @@ -785,12 +785,12 @@
"title": "Notify"
},
"poll": {
"title": "Poll",
"type": "integer"
"$ref": "#/$defs/templated-integer",
"title": "Poll"
},
"port": {
"title": "Port",
"type": "integer"
"$ref": "#/$defs/templated-integer",
"title": "Port"
},
"register": {
"title": "Register",
Expand All @@ -801,8 +801,8 @@
"type": "string"
},
"retries": {
"title": "Retries",
"type": "integer"
"$ref": "#/$defs/templated-integer",
"title": "Retries"
},
"run_once": {
"$ref": "#/$defs/templated-boolean",
Expand Down
40 changes: 22 additions & 18 deletions negative_test/roles/meta_invalid_role_namespace/meta/main.yml.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,35 @@
# ajv errors

```json
[
{
instancePath: '',
schemaPath: '#/anyOf/0/type',
keyword: 'type',
params: { type: 'null' },
message: 'must be null'
"instancePath": "",
"keyword": "type",
"message": "must be null",
"params": {
"type": "null"
},
"schemaPath": "#/anyOf/0/type"
},
{
instancePath: '/galaxy_info/namespace',
schemaPath: '#/properties/namespace/pattern',
keyword: 'pattern',
params: { pattern: '^[a-z][a-z0-9_]+$' },
message: 'must match pattern "^[a-z][a-z0-9_]+$"'
"instancePath": "/galaxy_info/namespace",
"keyword": "pattern",
"message": "must match pattern \"^[a-z][a-z0-9_]+$\"",
"params": {
"pattern": "^[a-z][a-z0-9_]+$"
},
"schemaPath": "#/properties/namespace/pattern"
},
{
instancePath: '',
schemaPath: '#/anyOf',
keyword: 'anyOf',
params: {},
message: 'must match a schema in anyOf'
"instancePath": "",
"keyword": "anyOf",
"message": "must match a schema in anyOf",
"params": {},
"schemaPath": "#/anyOf"
}
]
```


# check-jsonschema

stdout:
Expand All @@ -37,11 +41,11 @@ stdout:
{
"filename": "negative_test/roles/meta_invalid_role_namespace/meta/main.yml",
"path": "$",
"message": "{'galaxy_info': {'description': 'foo', 'min_ansible_version': '2.9', 'namespace': 'foo-bar', 'company': 'foo', 'license': 'MIT', 'platforms': [{'name': 'Alpine', 'versions': ['all']}]}} is not>
"message": "{'galaxy_info': {'description': 'foo', 'min_ansible_version': '2.9', 'namespace': 'foo-bar', 'company': 'foo', 'license': 'MIT', 'platforms': [{'name': 'Alpine', 'versions': ['all']}]}} is not valid under any of the given schemas",
"has_sub_errors": true,
"best_match": {
"path": "$",
"message": "{'galaxy_info': {'description': 'foo', 'min_ansible_version': '2.9', 'namespace': 'foo-bar', 'company': 'foo', 'license': 'MIT', 'platforms': [{'name': 'Alpine', 'versions': ['all']}]}} is n>
"message": "{'galaxy_info': {'description': 'foo', 'min_ansible_version': '2.9', 'namespace': 'foo-bar', 'company': 'foo', 'license': 'MIT', 'platforms': [{'name': 'Alpine', 'versions': ['all']}]}} is not of type 'null'"
}
}
]
Expand Down
5 changes: 5 additions & 0 deletions test/playbooks/tasks/templated_integers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- debug:
msg: foo
retries: "{{ 2 }}" # <-- valid
port: "{{ 80 }}" # <-- valid
poll: "{{ 2 }}" # <-- valid