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 | |
Monty Taylor | 7b871b4 | 2017-09-06 18:22:40 -0500 | [diff] [blame] | 13 | - name: Output a debug sentence |
| 14 | debug: |
| 15 | msg: This is a debug message |
| 16 | |
Monty Taylor | 0d254d5 | 2017-08-26 13:26:29 -0500 | [diff] [blame] | 17 | - name: Run a shell task |
| 18 | command: ip addr show |
| 19 | |
| 20 | - name: Loop with items |
| 21 | command: "echo {{ item }}" |
| 22 | with_items: |
| 23 | - item1 |
| 24 | - item2 |
| 25 | - item3 |
Monty Taylor | eb09398 | 2017-08-30 19:16:21 -0500 | [diff] [blame] | 26 | |
Monty Taylor | a36b3b3 | 2017-08-31 13:48:59 -0500 | [diff] [blame] | 27 | - name: Loop with complex items |
| 28 | command: "echo {{ item.name }}" |
| 29 | with_items: |
| 30 | - name: complex1 |
| 31 | - name: complex2 |
| 32 | - name: complex3 |
| 33 | |
Monty Taylor | eb09398 | 2017-08-30 19:16:21 -0500 | [diff] [blame] | 34 | - name: Run a shell task with an ansible python exception |
| 35 | command: echo foo |
| 36 | args: |
David Shrewsbury | 13d6e58 | 2017-08-31 13:03:12 -0400 | [diff] [blame] | 37 | chdir: /shelltask/somewhere/that/does/not/exist |
Monty Taylor | eb09398 | 2017-08-30 19:16:21 -0500 | [diff] [blame] | 38 | failed_when: false |
| 39 | |
| 40 | - name: Loop with items on an ansible python exception |
| 41 | command: "echo {{ item }}" |
| 42 | with_items: |
| 43 | - item1 |
| 44 | - item2 |
| 45 | - item3 |
| 46 | args: |
David Shrewsbury | 13d6e58 | 2017-08-31 13:03:12 -0400 | [diff] [blame] | 47 | chdir: /itemloop/somewhere/that/does/not/exist |
Monty Taylor | eb09398 | 2017-08-30 19:16:21 -0500 | [diff] [blame] | 48 | failed_when: false |
Tobias Henkel | e771b6e | 2017-10-25 14:23:31 +0200 | [diff] [blame^] | 49 | |
| 50 | - name: Print binary data |
| 51 | command: echo -e '\x80abc' |