From abfedb06c390f8cac200b3cbb9c328e4495f29ed Mon Sep 17 00:00:00 2001 From: Akira Yokochi Date: Fri, 31 Jul 2020 05:36:24 +0900 Subject: [PATCH] default_callback: Move 'check_mode_markers' in doc_fragments (#70228) (#70989) Callback plugin dense, yaml, and debug implement 'check_mode_markers' so moving documentation to default callback doc_fragments. Fixes: https://github.com/ansible-collections/community.general/issues/565 Signed-off-by: Abhijeet Kasurde (cherry picked from commit 4885ebad270cbdac34fdf5df7438a73a7a515d52) Co-authored-by: Abhijeet Kasurde --- changelogs/fragments/565_default_callback.yml | 2 ++ lib/ansible/plugins/callback/default.py | 18 ------------------ .../plugins/doc_fragments/default_callback.py | 14 ++++++++++++++ 3 files changed, 16 insertions(+), 18 deletions(-) create mode 100644 changelogs/fragments/565_default_callback.yml diff --git a/changelogs/fragments/565_default_callback.yml b/changelogs/fragments/565_default_callback.yml new file mode 100644 index 00000000000..73c60f46b71 --- /dev/null +++ b/changelogs/fragments/565_default_callback.yml @@ -0,0 +1,2 @@ +minor_changes: +- default_callback - moving 'check_mode_markers' documentation in default_callback doc_fragment (https://github.com/ansible-collections/community.general/issues/565). diff --git a/lib/ansible/plugins/callback/default.py b/lib/ansible/plugins/callback/default.py index 7fd38689cef..e735e0ad689 100644 --- a/lib/ansible/plugins/callback/default.py +++ b/lib/ansible/plugins/callback/default.py @@ -16,26 +16,8 @@ DOCUMENTATION = ''' - default_callback requirements: - set as stdout in configuration - options: - check_mode_markers: - name: Show markers when running in check mode - description: - - "Toggle to control displaying markers when running in check mode. The markers are C(DRY RUN) - at the beggining and ending of playbook execution (when calling C(ansible-playbook --check)) - and C(CHECK MODE) as a suffix at every play and task that is run in check mode." - type: bool - default: no - version_added: 2.9 - env: - - name: ANSIBLE_CHECK_MODE_MARKERS - ini: - - key: check_mode_markers - section: defaults ''' -# NOTE: check_mode_markers functionality is also implemented in the following derived plugins: -# debug.py, yaml.py, dense.py. Maybe their documentation needs updating, too. - from ansible import constants as C from ansible import context diff --git a/lib/ansible/plugins/doc_fragments/default_callback.py b/lib/ansible/plugins/doc_fragments/default_callback.py index 8093694a650..df3966b937c 100644 --- a/lib/ansible/plugins/doc_fragments/default_callback.py +++ b/lib/ansible/plugins/doc_fragments/default_callback.py @@ -68,4 +68,18 @@ class ModuleDocFragment(object): - key: show_per_host_start section: defaults version_added: '2.9' + check_mode_markers: + name: Show markers when running in check mode + description: + - Toggle to control displaying markers when running in check mode. + - "The markers are C(DRY RUN) at the beggining and ending of playbook execution (when calling C(ansible-playbook --check)) + and C(CHECK MODE) as a suffix at every play and task that is run in check mode." + type: bool + default: no + version_added: '2.9' + env: + - name: ANSIBLE_CHECK_MODE_MARKERS + ini: + - key: check_mode_markers + section: defaults '''