Debian Codegraph @

ansible_collections/community/general/plugins/callback/default_without_diff.py

raw
1 # Copyright (c) 2024, Felix Fontein <[email protected]>
2 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
3 # SPDX-License-Identifier: GPL-3.0-or-later
4
5 from __future__ import annotations
6
7 DOCUMENTATION = r"""
8 name: default_without_diff
9 type: stdout
10 short_description: The default ansible callback without diff output
11 version_added: 8.4.0
12 description:
13 - This is basically the default ansible callback plugin (P(ansible.builtin.default#callback)) without showing diff output.
14 This can be useful when using another callback which sends more detailed information to another service, like the L(ARA,
15 https://ara.recordsansible.org/) callback, and you want diff output sent to that plugin but not shown on the console output.
16 author: Felix Fontein (@felixfontein)
17 extends_documentation_fragment:
18 - ansible.builtin.default_callback
19 - ansible.builtin.result_format_callback
20 """
21
22 EXAMPLES = r"""
23 # Enable callback in ansible.cfg:
24 ansible_config: |
25 [defaults]
26 stdout_callback = community.general.default_without_diff
27
28 # Enable callback with environment variables:
29 environment_variable: |-
30 ANSIBLE_STDOUT_CALLBACK=community.general.default_without_diff
31 """
32
33 from ansible.plugins.callback.default import CallbackModule as Default
34
35
36 class CallbackModule(Default):
37 CALLBACK_VERSION = 2.0
38 CALLBACK_TYPE = "stdout"
39 CALLBACK_NAME = "community.general.default_without_diff"
40
41 def v2_on_file_diff(self, result):
42 pass