[stable-9] diy callback: add test for on_any_msg (#10550) (#10554)
Some checks are pending
EOL CI / EOL Sanity (Ⓐ2.13) (push) Waiting to run
EOL CI / EOL Sanity (Ⓐ2.14) (push) Waiting to run
EOL CI / EOL Sanity (Ⓐ2.15) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.13+py2.7) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.13+py3.8) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.14+py3.9) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.15+py3.10) (push) Waiting to run
EOL CI / EOL Units (Ⓐ2.15+py3.5) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.13+alpine3+py:azp/posix/1/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.13+alpine3+py:azp/posix/2/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.13+alpine3+py:azp/posix/3/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.13+fedora35+py:azp/posix/1/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.13+fedora35+py:azp/posix/2/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.13+fedora35+py:azp/posix/3/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.13+opensuse15py2+py:azp/posix/1/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.13+opensuse15py2+py:azp/posix/2/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.13+opensuse15py2+py:azp/posix/3/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.14+alpine3+py:azp/posix/1/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.14+alpine3+py:azp/posix/2/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.14+alpine3+py:azp/posix/3/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.15+fedora37+py:azp/posix/1/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.15+fedora37+py:azp/posix/2/) (push) Waiting to run
EOL CI / EOL I (Ⓐ2.15+fedora37+py:azp/posix/3/) (push) Waiting to run
nox / Run extra sanity tests (push) Waiting to run

diy callback: add test for on_any_msg (#10550)

Add test for on_any_msg.

(cherry picked from commit ac4aca2004)
This commit is contained in:
Felix Fontein 2025-08-02 18:02:57 +02:00 committed by GitHub
commit 018f4c989d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -460,3 +460,63 @@
"PLAY RECAP *********************************************************************",
"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"