Monty Taylor | 0d254d5 | 2017-08-26 13:26:29 -0500 | [diff] [blame] | 1 | - name: Run some commands to show that logging works |
| 2 | hosts: node |
| 3 | tasks: |
| 4 | |
| 5 | - name: Run setup |
| 6 | setup: |
| 7 | register: setupvar |
| 8 | |
| 9 | - name: Output debug for a var |
| 10 | debug: |
| 11 | var: setupvar |
| 12 | |
| 13 | - name: Run a shell task |
| 14 | command: ip addr show |
| 15 | |
| 16 | - name: Loop with items |
| 17 | command: "echo {{ item }}" |
| 18 | with_items: |
| 19 | - item1 |
| 20 | - item2 |
| 21 | - item3 |
Monty Taylor | eb09398 | 2017-08-30 19:16:21 -0500 | [diff] [blame] | 22 | |
Monty Taylor | a36b3b3 | 2017-08-31 13:48:59 -0500 | [diff] [blame] | 23 | - name: Loop with complex items |
| 24 | command: "echo {{ item.name }}" |
| 25 | with_items: |
| 26 | - name: complex1 |
| 27 | - name: complex2 |
| 28 | - name: complex3 |
| 29 | |
Monty Taylor | eb09398 | 2017-08-30 19:16:21 -0500 | [diff] [blame] | 30 | - name: Run a shell task with an ansible python exception |
| 31 | command: echo foo |
| 32 | args: |
David Shrewsbury | 13d6e58 | 2017-08-31 13:03:12 -0400 | [diff] [blame] | 33 | chdir: /shelltask/somewhere/that/does/not/exist |
Monty Taylor | eb09398 | 2017-08-30 19:16:21 -0500 | [diff] [blame] | 34 | failed_when: false |
| 35 | |
| 36 | - name: Loop with items on an ansible python exception |
| 37 | command: "echo {{ item }}" |
| 38 | with_items: |
| 39 | - item1 |
| 40 | - item2 |
| 41 | - item3 |
| 42 | args: |
David Shrewsbury | 13d6e58 | 2017-08-31 13:03:12 -0400 | [diff] [blame] | 43 | chdir: /itemloop/somewhere/that/does/not/exist |
Monty Taylor | eb09398 | 2017-08-30 19:16:21 -0500 | [diff] [blame] | 44 | failed_when: false |