blob: 6a31ff8d46b2b92cd307b6902cfc4259d8a3d863 [file] [log] [blame]
Monty Taylor0d254d52017-08-26 13:26:29 -05001- 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 Tayloreb093982017-08-30 19:16:21 -050022
Monty Taylora36b3b32017-08-31 13:48:59 -050023 - name: Loop with complex items
24 command: "echo {{ item.name }}"
25 with_items:
26 - name: complex1
27 - name: complex2
28 - name: complex3
29
Monty Tayloreb093982017-08-30 19:16:21 -050030 - name: Run a shell task with an ansible python exception
31 command: echo foo
32 args:
David Shrewsbury13d6e582017-08-31 13:03:12 -040033 chdir: /shelltask/somewhere/that/does/not/exist
Monty Tayloreb093982017-08-30 19:16:21 -050034 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 Shrewsbury13d6e582017-08-31 13:03:12 -040043 chdir: /itemloop/somewhere/that/does/not/exist
Monty Tayloreb093982017-08-30 19:16:21 -050044 failed_when: false