From 10fd59f67bd8bfcbb7360405babcda7f3c2d0cc0 Mon Sep 17 00:00:00 2001 From: Arnaud Patard Date: Thu, 23 Jun 2022 13:17:42 +0200 Subject: [PATCH] f/ansible.json: Allow conditional with import_playbook. According to https://docs.ansible.com/ansible/latest/user_guide/playbooks_conditionals.html#conditionals-with-imports, ansible allows to use conditional with import_playbook: "You can apply conditions to import_playbook as well as to the other import_* statements." The current schema does not allow it, so add support for it. [ As side effect, update a bunch of markdown failure files to have the correct message with when: ] Fixes: #316 Signed-off-by: Arnaud Patard --- f/ansible-playbook.json | 4 ++++ f/ansible.json | 4 ++++ negative_test/playbooks/environment.yml.md | 4 ++-- negative_test/playbooks/failed_when.yml.md | 4 ++-- negative_test/playbooks/gather_facts.yml.md | 4 ++-- negative_test/playbooks/gather_subset.yml.md | 4 ++-- negative_test/playbooks/gather_subset2.yml.md | 4 ++-- negative_test/playbooks/gather_subset3.yml.md | 4 ++-- negative_test/playbooks/gather_subset4.yml.md | 4 ++-- negative_test/playbooks/ignore_errors.yml.md | 4 ++-- negative_test/playbooks/invalid-failed-when.yml.md | 4 ++-- negative_test/playbooks/invalid-serial.yml.md | 4 ++-- negative_test/playbooks/invalid.yml.md | 4 ++-- negative_test/playbooks/invalid_become.yml.md | 4 ++-- negative_test/playbooks/local_action.yml.md | 4 ++-- negative_test/playbooks/loop.yml.md | 4 ++-- negative_test/playbooks/loop2.yml.md | 4 ++-- negative_test/playbooks/no_log_partial_template.yml.md | 4 ++-- negative_test/playbooks/no_log_string.yml.md | 4 ++-- negative_test/playbooks/roles.yml.md | 4 ++-- negative_test/playbooks/run_once_list.yml.md | 4 ++-- negative_test/playbooks/tags-mapping.yml.md | 4 ++-- negative_test/playbooks/tags-number.yml.md | 4 ++-- negative_test/playbooks/tasks.yml.md | 4 ++-- negative_test/playbooks/vas_prompt.yml.md | 4 ++-- negative_test/playbooks/with_cartesian.yml.md | 4 ++-- negative_test/playbooks/with_filetree.yml.md | 4 ++-- negative_test/playbooks/with_flattened.yml.md | 4 ++-- test/playbooks/import_playbook.yml | 4 ++++ 29 files changed, 64 insertions(+), 52 deletions(-) diff --git a/f/ansible-playbook.json b/f/ansible-playbook.json index ebbecbae..c5eed12b 100644 --- a/f/ansible-playbook.json +++ b/f/ansible-playbook.json @@ -41,6 +41,10 @@ "vars": { "title": "Vars", "type": "object" + }, + "when": { + "$ref": "#/$defs/complex_conditional", + "title": "When" } }, "type": "object" diff --git a/f/ansible.json b/f/ansible.json index f98bbb3b..cbf8d7fe 100644 --- a/f/ansible.json +++ b/f/ansible.json @@ -32,6 +32,10 @@ "vars": { "title": "Vars", "type": "object" + }, + "when": { + "$ref": "#/$defs/complex_conditional", + "title": "When" } }, "type": "object" diff --git a/negative_test/playbooks/environment.yml.md b/negative_test/playbooks/environment.yml.md index 35439dd2..ac873d53 100644 --- a/negative_test/playbooks/environment.yml.md +++ b/negative_test/playbooks/environment.yml.md @@ -99,12 +99,12 @@ stdout: "has_sub_errors": true, "best_match": { "path": "$[0]", - "message": "'environment', 'hosts' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars'" + "message": "'environment', 'hosts' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, "sub_errors": [ { "path": "$[0]", - "message": "'environment', 'hosts' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars'" + "message": "'environment', 'hosts' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, { "path": "$[0]", diff --git a/negative_test/playbooks/failed_when.yml.md b/negative_test/playbooks/failed_when.yml.md index eac11fe4..8f363cdc 100644 --- a/negative_test/playbooks/failed_when.yml.md +++ b/negative_test/playbooks/failed_when.yml.md @@ -126,12 +126,12 @@ stdout: "has_sub_errors": true, "best_match": { "path": "$[0]", - "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars'" + "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, "sub_errors": [ { "path": "$[0]", - "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars'" + "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, { "path": "$[0]", diff --git a/negative_test/playbooks/gather_facts.yml.md b/negative_test/playbooks/gather_facts.yml.md index 2cd99452..574ad3e4 100644 --- a/negative_test/playbooks/gather_facts.yml.md +++ b/negative_test/playbooks/gather_facts.yml.md @@ -92,12 +92,12 @@ stdout: "has_sub_errors": true, "best_match": { "path": "$[0]", - "message": "'gather_facts', 'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars'" + "message": "'gather_facts', 'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, "sub_errors": [ { "path": "$[0]", - "message": "'gather_facts', 'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars'" + "message": "'gather_facts', 'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, { "path": "$[0]", diff --git a/negative_test/playbooks/gather_subset.yml.md b/negative_test/playbooks/gather_subset.yml.md index 62da3527..9c7daac5 100644 --- a/negative_test/playbooks/gather_subset.yml.md +++ b/negative_test/playbooks/gather_subset.yml.md @@ -92,12 +92,12 @@ stdout: "has_sub_errors": true, "best_match": { "path": "$[0]", - "message": "'gather_subset', 'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars'" + "message": "'gather_subset', 'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, "sub_errors": [ { "path": "$[0]", - "message": "'gather_subset', 'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars'" + "message": "'gather_subset', 'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, { "path": "$[0]", diff --git a/negative_test/playbooks/gather_subset2.yml.md b/negative_test/playbooks/gather_subset2.yml.md index 7c364216..18c8967b 100644 --- a/negative_test/playbooks/gather_subset2.yml.md +++ b/negative_test/playbooks/gather_subset2.yml.md @@ -124,12 +124,12 @@ stdout: "has_sub_errors": true, "best_match": { "path": "$[0]", - "message": "'gather_subset', 'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars'" + "message": "'gather_subset', 'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, "sub_errors": [ { "path": "$[0]", - "message": "'gather_subset', 'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars'" + "message": "'gather_subset', 'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, { "path": "$[0]", diff --git a/negative_test/playbooks/gather_subset3.yml.md b/negative_test/playbooks/gather_subset3.yml.md index 17eb403c..ceaf7f31 100644 --- a/negative_test/playbooks/gather_subset3.yml.md +++ b/negative_test/playbooks/gather_subset3.yml.md @@ -142,12 +142,12 @@ stdout: "has_sub_errors": true, "best_match": { "path": "$[0]", - "message": "'gather_subset', 'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars'" + "message": "'gather_subset', 'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, "sub_errors": [ { "path": "$[0]", - "message": "'gather_subset', 'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars'" + "message": "'gather_subset', 'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, { "path": "$[0]", diff --git a/negative_test/playbooks/gather_subset4.yml.md b/negative_test/playbooks/gather_subset4.yml.md index 62706bec..4dfa6506 100644 --- a/negative_test/playbooks/gather_subset4.yml.md +++ b/negative_test/playbooks/gather_subset4.yml.md @@ -92,12 +92,12 @@ stdout: "has_sub_errors": true, "best_match": { "path": "$[0]", - "message": "'gather_subset', 'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars'" + "message": "'gather_subset', 'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, "sub_errors": [ { "path": "$[0]", - "message": "'gather_subset', 'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars'" + "message": "'gather_subset', 'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, { "path": "$[0]", diff --git a/negative_test/playbooks/ignore_errors.yml.md b/negative_test/playbooks/ignore_errors.yml.md index 91882ac9..fe99cbb1 100644 --- a/negative_test/playbooks/ignore_errors.yml.md +++ b/negative_test/playbooks/ignore_errors.yml.md @@ -144,12 +144,12 @@ stdout: "has_sub_errors": true, "best_match": { "path": "$[0]", - "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars'" + "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, "sub_errors": [ { "path": "$[0]", - "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars'" + "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, { "path": "$[0]", diff --git a/negative_test/playbooks/invalid-failed-when.yml.md b/negative_test/playbooks/invalid-failed-when.yml.md index ba590212..b6306ac5 100644 --- a/negative_test/playbooks/invalid-failed-when.yml.md +++ b/negative_test/playbooks/invalid-failed-when.yml.md @@ -178,12 +178,12 @@ stdout: "has_sub_errors": true, "best_match": { "path": "$[0]", - "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars'" + "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, "sub_errors": [ { "path": "$[0]", - "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars'" + "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, { "path": "$[0]", diff --git a/negative_test/playbooks/invalid-serial.yml.md b/negative_test/playbooks/invalid-serial.yml.md index a4f14add..374f9469 100644 --- a/negative_test/playbooks/invalid-serial.yml.md +++ b/negative_test/playbooks/invalid-serial.yml.md @@ -108,12 +108,12 @@ stdout: "has_sub_errors": true, "best_match": { "path": "$[0]", - "message": "'hosts', 'serial' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars'" + "message": "'hosts', 'serial' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, "sub_errors": [ { "path": "$[0]", - "message": "'hosts', 'serial' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars'" + "message": "'hosts', 'serial' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, { "path": "$[0]", diff --git a/negative_test/playbooks/invalid.yml.md b/negative_test/playbooks/invalid.yml.md index 82535c26..941d6fc3 100644 --- a/negative_test/playbooks/invalid.yml.md +++ b/negative_test/playbooks/invalid.yml.md @@ -54,12 +54,12 @@ stdout: "has_sub_errors": true, "best_match": { "path": "$[0]", - "message": "'hosts' does not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars'" + "message": "'hosts' does not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, "sub_errors": [ { "path": "$[0]", - "message": "'hosts' does not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars'" + "message": "'hosts' does not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, { "path": "$[0]", diff --git a/negative_test/playbooks/invalid_become.yml.md b/negative_test/playbooks/invalid_become.yml.md index ee9ba94f..d26ffb89 100644 --- a/negative_test/playbooks/invalid_become.yml.md +++ b/negative_test/playbooks/invalid_become.yml.md @@ -101,12 +101,12 @@ stdout: "has_sub_errors": true, "best_match": { "path": "$[0]", - "message": "'become', 'hosts' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars'" + "message": "'become', 'hosts' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, "sub_errors": [ { "path": "$[0]", - "message": "'become', 'hosts' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars'" + "message": "'become', 'hosts' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, { "path": "$[0]", diff --git a/negative_test/playbooks/local_action.yml.md b/negative_test/playbooks/local_action.yml.md index a3c2a4e0..e729a566 100644 --- a/negative_test/playbooks/local_action.yml.md +++ b/negative_test/playbooks/local_action.yml.md @@ -102,12 +102,12 @@ stdout: "has_sub_errors": true, "best_match": { "path": "$[0]", - "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars'" + "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, "sub_errors": [ { "path": "$[0]", - "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars'" + "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, { "path": "$[0]", diff --git a/negative_test/playbooks/loop.yml.md b/negative_test/playbooks/loop.yml.md index 04a6278b..01707689 100644 --- a/negative_test/playbooks/loop.yml.md +++ b/negative_test/playbooks/loop.yml.md @@ -102,12 +102,12 @@ stdout: "has_sub_errors": true, "best_match": { "path": "$[0]", - "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars'" + "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, "sub_errors": [ { "path": "$[0]", - "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars'" + "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, { "path": "$[0]", diff --git a/negative_test/playbooks/loop2.yml.md b/negative_test/playbooks/loop2.yml.md index 4d804fdb..c7d87f50 100644 --- a/negative_test/playbooks/loop2.yml.md +++ b/negative_test/playbooks/loop2.yml.md @@ -102,12 +102,12 @@ stdout: "has_sub_errors": true, "best_match": { "path": "$[0]", - "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars'" + "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, "sub_errors": [ { "path": "$[0]", - "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars'" + "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, { "path": "$[0]", diff --git a/negative_test/playbooks/no_log_partial_template.yml.md b/negative_test/playbooks/no_log_partial_template.yml.md index 4cb16872..855db92e 100644 --- a/negative_test/playbooks/no_log_partial_template.yml.md +++ b/negative_test/playbooks/no_log_partial_template.yml.md @@ -144,12 +144,12 @@ stdout: "has_sub_errors": true, "best_match": { "path": "$[0]", - "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars'" + "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, "sub_errors": [ { "path": "$[0]", - "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars'" + "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, { "path": "$[0]", diff --git a/negative_test/playbooks/no_log_string.yml.md b/negative_test/playbooks/no_log_string.yml.md index 24c56de7..a0639d44 100644 --- a/negative_test/playbooks/no_log_string.yml.md +++ b/negative_test/playbooks/no_log_string.yml.md @@ -144,12 +144,12 @@ stdout: "has_sub_errors": true, "best_match": { "path": "$[0]", - "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars'" + "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, "sub_errors": [ { "path": "$[0]", - "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars'" + "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, { "path": "$[0]", diff --git a/negative_test/playbooks/roles.yml.md b/negative_test/playbooks/roles.yml.md index 488d727a..dd2832b3 100644 --- a/negative_test/playbooks/roles.yml.md +++ b/negative_test/playbooks/roles.yml.md @@ -83,12 +83,12 @@ stdout: "has_sub_errors": true, "best_match": { "path": "$[0]", - "message": "'hosts', 'roles' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars'" + "message": "'hosts', 'roles' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, "sub_errors": [ { "path": "$[0]", - "message": "'hosts', 'roles' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars'" + "message": "'hosts', 'roles' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, { "path": "$[0]", diff --git a/negative_test/playbooks/run_once_list.yml.md b/negative_test/playbooks/run_once_list.yml.md index cf398291..be03ca4b 100644 --- a/negative_test/playbooks/run_once_list.yml.md +++ b/negative_test/playbooks/run_once_list.yml.md @@ -162,12 +162,12 @@ stdout: "has_sub_errors": true, "best_match": { "path": "$[0]", - "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars'" + "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, "sub_errors": [ { "path": "$[0]", - "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars'" + "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, { "path": "$[0]", diff --git a/negative_test/playbooks/tags-mapping.yml.md b/negative_test/playbooks/tags-mapping.yml.md index b4969277..ce001eb5 100644 --- a/negative_test/playbooks/tags-mapping.yml.md +++ b/negative_test/playbooks/tags-mapping.yml.md @@ -115,12 +115,12 @@ stdout: "has_sub_errors": true, "best_match": { "path": "$[0]", - "message": "'hosts' does not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars'" + "message": "'hosts' does not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, "sub_errors": [ { "path": "$[0]", - "message": "'hosts' does not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars'" + "message": "'hosts' does not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, { "path": "$[0]", diff --git a/negative_test/playbooks/tags-number.yml.md b/negative_test/playbooks/tags-number.yml.md index 210931a0..6137d400 100644 --- a/negative_test/playbooks/tags-number.yml.md +++ b/negative_test/playbooks/tags-number.yml.md @@ -115,12 +115,12 @@ stdout: "has_sub_errors": true, "best_match": { "path": "$[0]", - "message": "'hosts' does not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars'" + "message": "'hosts' does not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, "sub_errors": [ { "path": "$[0]", - "message": "'hosts' does not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars'" + "message": "'hosts' does not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, { "path": "$[0]", diff --git a/negative_test/playbooks/tasks.yml.md b/negative_test/playbooks/tasks.yml.md index 96175cc1..4eba18b7 100644 --- a/negative_test/playbooks/tasks.yml.md +++ b/negative_test/playbooks/tasks.yml.md @@ -149,12 +149,12 @@ stdout: "has_sub_errors": true, "best_match": { "path": "$[0]", - "message": "'handlers', 'hosts', 'post_tasks', 'pre_tasks', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars'" + "message": "'handlers', 'hosts', 'post_tasks', 'pre_tasks', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, "sub_errors": [ { "path": "$[0]", - "message": "'handlers', 'hosts', 'post_tasks', 'pre_tasks', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars'" + "message": "'handlers', 'hosts', 'post_tasks', 'pre_tasks', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, { "path": "$[0]", diff --git a/negative_test/playbooks/vas_prompt.yml.md b/negative_test/playbooks/vas_prompt.yml.md index 4903629f..e5df1f8d 100644 --- a/negative_test/playbooks/vas_prompt.yml.md +++ b/negative_test/playbooks/vas_prompt.yml.md @@ -83,12 +83,12 @@ stdout: "has_sub_errors": true, "best_match": { "path": "$[0]", - "message": "'hosts' does not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars'" + "message": "'hosts' does not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, "sub_errors": [ { "path": "$[0]", - "message": "'hosts' does not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars'" + "message": "'hosts' does not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, { "path": "$[0]", diff --git a/negative_test/playbooks/with_cartesian.yml.md b/negative_test/playbooks/with_cartesian.yml.md index 18ad5a2e..91adece5 100644 --- a/negative_test/playbooks/with_cartesian.yml.md +++ b/negative_test/playbooks/with_cartesian.yml.md @@ -97,12 +97,12 @@ stdout: "has_sub_errors": true, "best_match": { "path": "$[0]", - "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars'" + "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, "sub_errors": [ { "path": "$[0]", - "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars'" + "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, { "path": "$[0]", diff --git a/negative_test/playbooks/with_filetree.yml.md b/negative_test/playbooks/with_filetree.yml.md index c339614f..48af15ef 100644 --- a/negative_test/playbooks/with_filetree.yml.md +++ b/negative_test/playbooks/with_filetree.yml.md @@ -97,12 +97,12 @@ stdout: "has_sub_errors": true, "best_match": { "path": "$[0]", - "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars'" + "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, "sub_errors": [ { "path": "$[0]", - "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars'" + "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, { "path": "$[0]", diff --git a/negative_test/playbooks/with_flattened.yml.md b/negative_test/playbooks/with_flattened.yml.md index 5593c314..d42247c9 100644 --- a/negative_test/playbooks/with_flattened.yml.md +++ b/negative_test/playbooks/with_flattened.yml.md @@ -97,12 +97,12 @@ stdout: "has_sub_errors": true, "best_match": { "path": "$[0]", - "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars'" + "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, "sub_errors": [ { "path": "$[0]", - "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars'" + "message": "'hosts', 'tasks' do not match any of the regexes: '^(ansible\\\\.builtin\\\\.)?import_playbook$', 'name', 'tags', 'vars', 'when'" }, { "path": "$[0]", diff --git a/test/playbooks/import_playbook.yml b/test/playbooks/import_playbook.yml index 8afca34c..efd87879 100644 --- a/test/playbooks/import_playbook.yml +++ b/test/playbooks/import_playbook.yml @@ -3,3 +3,7 @@ - import_playbook: other.yml tags: - foo + +- import_playbook: other.yml + when: + - foo is true