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

Allow inventory to be used for playbook order key #4182

Merged
merged 1 commit into from
May 22, 2024
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
11 changes: 6 additions & 5 deletions src/ansiblelint/schemas/ansible.json
Original file line number Diff line number Diff line change
Expand Up @@ -548,19 +548,20 @@
"oneOf": [
{
"enum": [
"default",
"sorted",
"reverse_sorted",
"inventory",
"reverse_inventory",
"shuffle"
"reverse_sorted",
"shuffle",
"sorted"
],
"type": "string"
},
{
"$ref": "#/$defs/full-jinja"
}
],
"title": "Order"
"title": "Order",
"markdownDescription": "See https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_strategies.html#ordering-execution-based-on-inventory"
},
"port": {
"$ref": "#/$defs/templated-integer",
Expand Down
9 changes: 5 additions & 4 deletions src/ansiblelint/schemas/playbook.json
Original file line number Diff line number Diff line change
Expand Up @@ -555,14 +555,15 @@
"$ref": "#/$defs/templated-boolean"
},
"order": {
"markdownDescription": "See https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_strategies.html#ordering-execution-based-on-inventory",
"oneOf": [
{
"enum": [
"default",
"sorted",
"reverse_sorted",
"inventory",
"reverse_inventory",
"shuffle"
"reverse_sorted",
"shuffle",
"sorted"
],
"type": "string"
},
Expand Down
7 changes: 6 additions & 1 deletion test/schemas/test/playbooks/order.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
---
- name: Test
hosts: all
hosts: localhost
order: "{{ host_order | default('shuffle') }}"
gather_facts: false
serial: 1
tasks:
- name: ABC
ansible.builtin.debug:
msg: "hello"
- name: Test 2
hosts: localhost
order: inventory
gather_facts: false
tasks: []
Loading