Skip to content

Commit 4f418ce

Browse files
[PR #11656/4dad53ab backport][stable-11] counter_enabled callback: honor display_ok_hosts setting (#11666)
counter_enabled callback: honor display_ok_hosts setting (#11656) * fix(callback/counter_enabled): honor display_ok_hosts setting * add changelog frag * Update changelogs/fragments/11656-counter_enabled-display_ok_hosts.yml (cherry picked from commit 4dad53a) Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
1 parent fb26dbf commit 4f418ce

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
bugfixes:
2+
- counter_enabled callback plugin - fix plugin not observing ``display_ok_hosts`` option (https://github.com/ansible-collections/community.general/issues/3978, https://github.com/ansible-collections/community.general/pull/11656).

plugins/callback/counter_enabled.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,8 @@ def v2_runner_on_ok(self, result):
164164
msg = f"changed: {self._host_counter}/{self._host_total} [{result._host.get_name()}]"
165165
color = C.COLOR_CHANGED
166166
else:
167+
if not self._plugin_options.get("display_ok_hosts", True):
168+
return
167169
if delegated_vars:
168170
msg = f"ok: {self._host_counter}/{self._host_total} [{result._host.get_name()} -> {delegated_vars['ansible_host']}]"
169171
else:

0 commit comments

Comments
 (0)