Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update schema to accept a list for 'listen' #2817

Merged
merged 2 commits into from
Dec 14, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
16 changes: 13 additions & 3 deletions src/ansiblelint/schemas/ansible.json
Original file line number Diff line number Diff line change
Expand Up @@ -911,9 +911,19 @@
"type": "boolean"
},
"listen": {
"markdownDescription": "Applies only to handlers. See [listen](https://docs.ansible.com/ansible/latest/user_guide/playbooks_intro.html#handlers-running-when-notified)",
"title": "Listen",
"type": "string"
"anyOf": [
{
"type": "string"
},
{
"items": {
"type": "string"
},
"type": "array"
}
],
"markdownDescription": "Applies only to handlers. See [listen](https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_handlers.html)",
"title": "Listen"
},
"local_action": {
"title": "Local Action",
Expand Down
16 changes: 13 additions & 3 deletions src/ansiblelint/schemas/playbook.json
Original file line number Diff line number Diff line change
Expand Up @@ -933,9 +933,19 @@
"type": "boolean"
},
"listen": {
"markdownDescription": "Applies only to handlers. See [listen](https://docs.ansible.com/ansible/latest/user_guide/playbooks_intro.html#handlers-running-when-notified)",
"title": "Listen",
"type": "string"
"anyOf": [
{
"type": "string"
},
{
"items": {
"type": "string"
},
"type": "array"
}
],
"markdownDescription": "Applies only to handlers. See [listen](https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_handlers.html)",
"title": "Listen"
},
"local_action": {
"title": "Local Action",
Expand Down
16 changes: 13 additions & 3 deletions src/ansiblelint/schemas/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -385,9 +385,19 @@
"type": "boolean"
},
"listen": {
"markdownDescription": "Applies only to handlers. See [listen](https://docs.ansible.com/ansible/latest/user_guide/playbooks_intro.html#handlers-running-when-notified)",
"title": "Listen",
"type": "string"
"anyOf": [
{
"type": "string"
},
{
"items": {
"type": "string"
},
"type": "array"
}
],
"markdownDescription": "Applies only to handlers. See [listen](https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_handlers.html)",
"title": "Listen"
},
"local_action": {
"title": "Local Action",
Expand Down
7 changes: 7 additions & 0 deletions test/schemas/test/playbooks/run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@
msg: "I am handler 1"
listen: "always handler"

- name: handler 2
ansible.builtin.debug:
msg: "I am handler 2"
listen: # to check if lists are allowed:
- "list listening handler"
- "other listening topic"

- hosts: localhost
serial: 1 # validate serial allows integer

Expand Down