mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
Bugfixes and integration tests for 'default' callback plugin
* display 'changed' tasks when hiding 'ok' tasks * display proper task title for handlers (fixes #44007)
This commit is contained in:
committed by
Matt Clay
parent
742ba04125
commit
5708894f90
60
test/integration/targets/callback_default/test.yml
Normal file
60
test/integration/targets/callback_default/test.yml
Normal file
@@ -0,0 +1,60 @@
|
||||
---
|
||||
- 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 }}
|
||||
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
|
||||
Reference in New Issue
Block a user