mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-05 05:34:22 -07:00
diy callback: add test for on_any_msg (#10550)
Add test for on_any_msg.
This commit is contained in:
parent
7298f25fe0
commit
ac4aca2004
1 changed files with 60 additions and 0 deletions
|
@ -443,3 +443,63 @@
|
||||||
- ""
|
- ""
|
||||||
- "PLAY RECAP *********************************************************************"
|
- "PLAY RECAP *********************************************************************"
|
||||||
- "testhost : ok=1 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 "
|
- "testhost : ok=1 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 "
|
||||||
|
|
||||||
|
- name: Set on_any_msg
|
||||||
|
environment:
|
||||||
|
ANSIBLE_NOCOLOR: 'true'
|
||||||
|
ANSIBLE_FORCE_COLOR: 'false'
|
||||||
|
ANSIBLE_STDOUT_CALLBACK: community.general.diy
|
||||||
|
ANSIBLE_CALLBACK_DIY_ON_ANY_MSG: foo
|
||||||
|
playbook: !unsafe |
|
||||||
|
- hosts: testhost
|
||||||
|
gather_facts: false
|
||||||
|
tasks:
|
||||||
|
- name: A loop
|
||||||
|
debug:
|
||||||
|
msg: "{{ item }}"
|
||||||
|
loop:
|
||||||
|
- 1
|
||||||
|
- 2
|
||||||
|
- name: Sample task name
|
||||||
|
debug:
|
||||||
|
msg: sample debug msg
|
||||||
|
- name: Skipped task
|
||||||
|
command: ls /
|
||||||
|
when: false
|
||||||
|
expected_output:
|
||||||
|
- "foo"
|
||||||
|
- ""
|
||||||
|
- "PLAY [testhost] ****************************************************************"
|
||||||
|
- "foo"
|
||||||
|
- ""
|
||||||
|
- "TASK [A loop] ******************************************************************"
|
||||||
|
- "foo"
|
||||||
|
- "foo"
|
||||||
|
- "ok: [testhost] => (item=1) => {"
|
||||||
|
- " \"msg\": 1"
|
||||||
|
- "}"
|
||||||
|
- "foo"
|
||||||
|
- "ok: [testhost] => (item=2) => {"
|
||||||
|
- " \"msg\": 2"
|
||||||
|
- "}"
|
||||||
|
- "foo"
|
||||||
|
- "foo"
|
||||||
|
- ""
|
||||||
|
- "TASK [Sample task name] ********************************************************"
|
||||||
|
- "foo"
|
||||||
|
- "foo"
|
||||||
|
- "ok: [testhost] => {"
|
||||||
|
- " \"msg\": \"sample debug msg\""
|
||||||
|
- "}"
|
||||||
|
- "foo"
|
||||||
|
- ""
|
||||||
|
- "TASK [Skipped task] ************************************************************"
|
||||||
|
- "foo"
|
||||||
|
- "foo"
|
||||||
|
- "skipping: [testhost]"
|
||||||
|
- "foo"
|
||||||
|
- ""
|
||||||
|
- "PLAY RECAP *********************************************************************"
|
||||||
|
- "testhost : ok=2 changed=0 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0 "
|
||||||
|
- ""
|
||||||
|
- "foo"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue