Debian Codegraph @

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

raw
1 #!/usr/bin/python
2 # -*- coding: utf-8 -*-
3
4 # (c) 2022, John McCall (@lowlydba)
5 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
6
7 DOCUMENTATION = r'''
8 ---
9 module: hadr
10 short_description: Enable or disable HADR
11 description:
12 - Enable or disable the High Availability Disaster Recovery (HADR) feature.
13 version_added: 0.4.0
14 options:
15 sql_instance:
16 description:
17 - The SQL Server instance to modify.
18 type: str
19 required: true
20 username:
21 description:
22 - Username for alternative credential to authenticate with Windows.
23 type: str
24 required: false
25 password:
26 description:
27 - Password for alternative credential to authenticate with Windows.
28 type: str
29 required: false
30 enabled:
31 description:
32 - Flag to enable or disable the feature.
33 type: bool
34 required: false
35 default: true
36 force:
37 description:
38 - Restart SQL Server and SQL Agent services automatically.
39 type: bool
40 required: false
41 default: false
42 author: "John McCall (@lowlydba)"
43 requirements:
44 - L(dbatools,https://www.powershellgallery.com/packages/dbatools/) PowerShell module
45 extends_documentation_fragment:
46 - lowlydba.sqlserver.sql_credentials
47 - lowlydba.sqlserver.attributes.check_mode
48 - lowlydba.sqlserver.attributes.platform_win
49 '''
50
51 EXAMPLES = r'''
52 - name: Enable hadr with service restart
53 lowlydba.sqlserver.hadr:
54 sql_instance: sql-01.myco.io
55 enabled: true
56 force: true
57 '''
58
59 RETURN = r'''
60 data:
61 description:
62 - Output from the C(Enable-DbaAgHadr) or C(Disable-DbaAgHadr) function.
63 - RestartRequired returned if the setting requires a service restart to take effect.
64 returned: success, but not in check_mode.
65 type: dict
66 '''