Debian Codegraph @

ansible_collections/lowlydba/sqlserver/plugins/modules/traceflag.py

raw
1 #!/usr/bin/python
2 # -*- coding: utf-8 -*-
3
4 # (c) 2022, John McCall (@lowlydba)
5 # (c) 2021, Sudhir Koduri (@kodurisudhir)
6 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
7
8 DOCUMENTATION = r'''
9 ---
10 module: traceflag
11 short_description: Enable or disable global trace flags on a SQL Server instance
12 description:
13 - Enable\Disable global trace flag on a SQL Instance. This trace flag takes affect immediately and does not require SQL Instance restart.
14 - This setting does not persist after restart.
15 version_added: 0.1.0
16 options:
17 trace_flag:
18 description:
19 - Trace Flag number.
20 type: int
21 required: true
22 enabled:
23 description:
24 - Flag to enable or disable the trace flag.
25 type: bool
26 required: true
27 author: "Sudhir Koduri (@kodurisudhir)"
28 requirements:
29 - L(dbatools,https://www.powershellgallery.com/packages/dbatools/) PowerShell module
30 extends_documentation_fragment:
31 - lowlydba.sqlserver.sql_credentials
32 - lowlydba.sqlserver.attributes.check_mode
33 - lowlydba.sqlserver.attributes.platform_all
34 '''
35
36 EXAMPLES = r'''
37 - name: Eliminate successful backup information from SQL Error Log
38 lowlydba.sqlserver.traceflag:
39 sql_instance: sql-01.myco.io
40 trace_flag: 3226
41 enabled: true
42
43 - name: Disable trace flag
44 lowlydba.sqlserver.traceflag:
45 sql_instance: sql-01.myco.io
46 trace_flag: 3226
47 enabled: false
48 '''
49
50 RETURN = r'''
51 data:
52 description: Output from the C(Enable-DbaTraceFlag) or C(Disable-DbaTraceFlag) function.
53 returned: success, but not in check_mode.
54 type: dict
55 '''