forked from ansible/ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix nested noop block padding in dynamic includes (ansible#38814)
* Fix nested noop block padding in dynamic includes * Address issues from the review * Fix typo
- Loading branch information
Showing
7 changed files
with
74 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
posix/ci/group3 |
6 changes: 6 additions & 0 deletions
6
test/integration/targets/strategy_linear/roles/role1/tasks/main.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
- name: Include tasks | ||
include_tasks: "tasks.yml" | ||
|
||
- name: Mark role as finished | ||
set_fact: | ||
role1_complete: True |
7 changes: 7 additions & 0 deletions
7
test/integration/targets/strategy_linear/roles/role1/tasks/tasks.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
- name: Call role2 | ||
include_role: | ||
name: role2 | ||
|
||
- name: Call role2 again | ||
include_role: | ||
name: role2 |
7 changes: 7 additions & 0 deletions
7
test/integration/targets/strategy_linear/roles/role2/tasks/main.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
- block: | ||
- block: | ||
- name: Nested task 1 | ||
debug: msg="Nested task 1" | ||
|
||
- name: Nested task 2 | ||
debug: msg="Nested task 2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -eux | ||
|
||
ansible-playbook test_include_file_noop.yml -i ../../inventory "$@" |
16 changes: 16 additions & 0 deletions
16
test/integration/targets/strategy_linear/test_include_file_noop.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
- hosts: | ||
- testhost | ||
- testhost2 | ||
gather_facts: no | ||
vars: | ||
secondhost: testhost2 | ||
tasks: | ||
- name: Call the first role only on one host | ||
include_role: | ||
name: role1 | ||
when: inventory_hostname is match(secondhost) | ||
|
||
- name: Make sure nothing else runs until role1 finishes | ||
assert: | ||
that: | ||
- "'role1_complete' in hostvars[secondhost]" |