diff --git a/changelogs/fragments/colors_for_included_events.yml b/changelogs/fragments/colors_for_included_events.yml new file mode 100644 index 00000000000..0ff029717cb --- /dev/null +++ b/changelogs/fragments/colors_for_included_events.yml @@ -0,0 +1,4 @@ +bugfixes: + - COLOR_SKIP will not alter "included" events color display anymore. +minor_changes: + - Introducing COLOR_INCLUDED parameter. This can set a specific color for "included" events. diff --git a/lib/ansible/config/base.yml b/lib/ansible/config/base.yml index 6fabaee0813..a6435cc716a 100644 --- a/lib/ansible/config/base.yml +++ b/lib/ansible/config/base.yml @@ -304,6 +304,14 @@ COLOR_HIGHLIGHT: env: [{name: ANSIBLE_COLOR_HIGHLIGHT}] ini: - {key: highlight, section: colors} +COLOR_INCLUDED: + name: Color for 'included' task status + default: cyan + description: Defines the color to use when showing 'Included' task status. + env: [{name: ANSIBLE_COLOR_INCLUDED}] + ini: + - {key: included, section: colors} + version_added: '2.18' COLOR_OK: name: Color for 'ok' task status default: green diff --git a/lib/ansible/plugins/callback/default.py b/lib/ansible/plugins/callback/default.py index c96d9ababcb..4a0bf0d05bc 100644 --- a/lib/ansible/plugins/callback/default.py +++ b/lib/ansible/plugins/callback/default.py @@ -293,7 +293,7 @@ class CallbackModule(CallbackBase): label = self._get_item_label(included_file._vars) if label: msg += " => (item=%s)" % label - self._display.display(msg, color=C.COLOR_SKIP) + self._display.display(msg, color=C.COLOR_INCLUDED) def v2_playbook_on_stats(self, stats): self._display.banner("PLAY RECAP") diff --git a/lib/ansible/utils/display.py b/lib/ansible/utils/display.py index 2379aecf6d9..e514155e16d 100644 --- a/lib/ansible/utils/display.py +++ b/lib/ansible/utils/display.py @@ -172,6 +172,7 @@ if getattr(C, 'DEFAULT_LOG_PATH'): color_to_log_level = {C.COLOR_DEBUG: logging.DEBUG, C.COLOR_VERBOSE: logging.INFO, C.COLOR_OK: logging.INFO, + C.COLOR_INCLUDED: logging.INFO, C.COLOR_CHANGED: logging.INFO, C.COLOR_SKIP: logging.WARNING, C.COLOR_DEPRECATE: logging.WARNING,