-
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.
- Loading branch information
1 parent
25d9196
commit 58829ff
Showing
4 changed files
with
128 additions
and
32 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,34 @@ | ||
- name: Test | ||
hosts: test | ||
tasks: | ||
- name: loop | ||
command: echo {{ item }} | ||
loop: | ||
- 1 | ||
- 2 | ||
- 3 | ||
|
||
- name: loop inner | ||
command: echo {{ item.name }} ({{ item.count }}) | ||
loop: | ||
- { name: 'Test', count: 30 } | ||
- { name: 'Test 2', count: 25 } | ||
- { name: 'Test 3', count: 10 } | ||
- { name: 'Test 4', count: 40 } | ||
|
||
- name: loop (debug) | ||
debug: | ||
item: "{{ item }}" | ||
loop: | ||
- 1 | ||
- 2 | ||
- 3 | ||
|
||
- name: loop inner (debug) | ||
debug: | ||
item: "{{ item.name }} ({{ item.count }})" | ||
loop: | ||
- { name: 'Test', count: 30 } | ||
- { name: 'Test 2', count: 25 } | ||
- { name: 'Test 3', count: 10 } | ||
- { name: 'Test 4', count: 40 } |
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,45 @@ | ||
Starting deployment: Test | ||
|
||
Executing task: loop | ||
> echo 1 | ||
1 | ||
> echo 2 | ||
2 | ||
> echo 3 | ||
3 | ||
|
||
Executing task: loop inner | ||
> echo Test (30) | ||
Test (30) | ||
> echo Test 2 (25) | ||
Test 2 (25) | ||
> echo Test 3 (10) | ||
Test 3 (10) | ||
> echo Test 4 (40) | ||
Test 4 (40) | ||
|
||
Executing task: loop (debug) | ||
Debug: | ||
item: | ||
1 | ||
Debug: | ||
item: | ||
2 | ||
Debug: | ||
item: | ||
3 | ||
|
||
Executing task: loop inner (debug) | ||
Debug: | ||
item: | ||
Test (30) | ||
Debug: | ||
item: | ||
Test 2 (25) | ||
Debug: | ||
item: | ||
Test 3 (10) | ||
Debug: | ||
item: | ||
Test 4 (40) | ||
|
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