mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
be9f07279e
* Adding rescued/ignored tasks to stats gathering Fixes #31245 * Amend integration tests to pass * callback/dense.py: fix too-many-format-args * Add changelog * Amend counter_enabled and unixy callbacks * Fix syntax error * Fix typo in the changelog * Remove not needed comment * Re-add skipped * Add test for rescued * Fix colors... * Fix unstable tests? * Add a note to the porting guide * Re-word the note in the porting guide Fixes #20346 Fixes #24525 Fixes #14393 Co-authored-by: James Cammarata <jimi@sngx.net> Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
68 lines
1.4 KiB
YAML
68 lines
1.4 KiB
YAML
---
|
|
- hosts: testhost
|
|
gather_facts: no
|
|
vars:
|
|
foo: foo bar
|
|
tasks:
|
|
- name: Changed task
|
|
command: echo foo
|
|
changed_when: true
|
|
notify: test handlers
|
|
|
|
- name: Ok task
|
|
command: echo foo
|
|
changed_when: false
|
|
|
|
- name: Failed task
|
|
fail:
|
|
msg: no reason
|
|
ignore_errors: yes
|
|
|
|
- name: Skipped task
|
|
command: echo foo
|
|
when: false
|
|
|
|
- name: Task with var in name ({{ foo }})
|
|
command: echo foo
|
|
|
|
- name: Loop task
|
|
command: echo foo
|
|
loop:
|
|
- 1
|
|
- 2
|
|
- 3
|
|
loop_control:
|
|
label: foo-{{ item }}
|
|
|
|
- block:
|
|
- name: EXPECTED FAILURE Failed task to be rescued
|
|
fail:
|
|
rescue:
|
|
- name: Rescue task
|
|
command: echo rescued
|
|
|
|
handlers:
|
|
- name: Test handler 1
|
|
command: echo foo
|
|
listen: test handlers
|
|
|
|
- name: Test handler 2
|
|
command: echo foo
|
|
changed_when: false
|
|
listen: test handlers
|
|
|
|
- name: Test handler 3
|
|
command: echo foo
|
|
listen: test handlers
|
|
|
|
# An issue was found previously for tasks in a play using strategy 'free' after
|
|
# a non-'free' play in the same playbook, so we protect against a regression.
|
|
- hosts: testhost
|
|
gather_facts: no
|
|
strategy: free
|
|
tasks:
|
|
- name: First free task
|
|
command: echo foo
|
|
|
|
- name: Second free task
|
|
command: echo foo
|