- name: Run some commands to show that logging works on failed tasks too | |
hosts: node | |
tasks: | |
- block: | |
- name: Run a shell task with an ansible python exception | |
command: echo foo | |
args: | |
chdir: /somewhere/that/does/not/exist | |
- always: | |
- name: Loop with items on an ansible python exception | |
command: "echo {{ item }}" | |
with_items: | |
- item1 | |
- item2 | |
- item3 | |
args: | |
chdir: /somewhere/that/does/not/exist |