mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
add option to display per host start to default (#53819)
* add option to display per host start to default
This commit is contained in:
parent
5eb3117822
commit
9f87552f06
4 changed files with 18 additions and 1 deletions
2
changelogs/fragments/show_host_start.yml
Normal file
2
changelogs/fragments/show_host_start.yml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
minor_changes:
|
||||||
|
- Add toggle to show per host task start on default callback
|
|
@ -227,6 +227,10 @@ class CallbackModule(CallbackBase):
|
||||||
def v2_playbook_on_handler_task_start(self, task):
|
def v2_playbook_on_handler_task_start(self, task):
|
||||||
self._task_start(task, prefix='RUNNING HANDLER')
|
self._task_start(task, prefix='RUNNING HANDLER')
|
||||||
|
|
||||||
|
def v2_runner_on_start(self, host, task):
|
||||||
|
if self.get_option('show_per_host_start'):
|
||||||
|
self._display.display(" [started %s on %s]" % (task, host), color=C.COLOR_OK)
|
||||||
|
|
||||||
def v2_playbook_on_play_start(self, play):
|
def v2_playbook_on_play_start(self, play):
|
||||||
name = play.get_name().strip()
|
name = play.get_name().strip()
|
||||||
if not name:
|
if not name:
|
||||||
|
|
|
@ -55,4 +55,15 @@ class ModuleDocFragment(object):
|
||||||
ini:
|
ini:
|
||||||
- key: show_custom_stats
|
- key: show_custom_stats
|
||||||
section: defaults
|
section: defaults
|
||||||
|
show_per_host_start:
|
||||||
|
name: Show per host task start
|
||||||
|
description: 'This adds output that shows when a task is started to execute for each host'
|
||||||
|
type: bool
|
||||||
|
default: no
|
||||||
|
env:
|
||||||
|
- name: ANSIBLE_SHOW_PER_HOST_START
|
||||||
|
ini:
|
||||||
|
- key: show_per_host_start
|
||||||
|
section: defaults
|
||||||
|
version_added: '2.9'
|
||||||
'''
|
'''
|
||||||
|
|
|
@ -12,5 +12,5 @@
|
||||||
- assert:
|
- assert:
|
||||||
that:
|
that:
|
||||||
- "pbexec_json.rc == 0"
|
- "pbexec_json.rc == 0"
|
||||||
- "pbexec_json.events|length == 6"
|
- "pbexec_json.events|length == 7"
|
||||||
- "'localhost' in pbexec_json.stats.ok"
|
- "'localhost' in pbexec_json.stats.ok"
|
||||||
|
|
Loading…
Reference in a new issue