Debian Codegraph @

ansible_collections/lowlydba/sqlserver/plugins/modules/spn.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: spn
10 short_description: Configures SPNs for SQL Server
11 description:
12 - Configures SPNs for SQL Server.
13 version_added: 0.6.0
14 options:
15 computer_username:
16 description:
17 - Username of a credential to connect to Active Directory with.
18 type: str
19 required: false
20 computer_password:
21 description:
22 - Password of a credential to connect to Active Directory with.
23 type: str
24 required: false
25 computer:
26 description:
27 - The host or alias to configure the SPN for. Can include the port in the format C(host:port).
28 type: str
29 required: true
30 service_account:
31 description:
32 - The account you want the SPN added to. Will be looked up if not provided.
33 type: str
34 required: true
35 author: "John McCall (@lowlydba)"
36 requirements:
37 - L(dbatools,https://www.powershellgallery.com/packages/dbatools/) PowerShell module
38 extends_documentation_fragment:
39 - lowlydba.sqlserver.state
40 - lowlydba.sqlserver.attributes.check_mode
41 - lowlydba.sqlserver.attributes.platform_win
42 '''
43
44 EXAMPLES = r'''
45 - name: Add server SPN
46 lowlydba.sqlserver.spn:
47 computer: sql-01.myco.io
48 service_account: myco\sql-svc
49
50 - name: Create an AG Listener
51 lowlydba.sqlserver.ag_listener:
52 sql_instance_primary: sql-01.myco.io
53 ag_name: AG_MyDatabase
54 listener_name: aglMyDatabase
55 ip_address:
56 - 10.0.20.20
57 - 10.1.77.77
58 subnet_ip:
59 - 255.255.252.0
60 subnet_mask:
61 - 255.255.255.0
62
63 - name: Add SPN for new AG listener on port 1433
64 lowlydba.sqlserver.spn:
65 computer: aglMyDatabase.myco.io:1433
66 service_account: myco\sql-svc
67 '''
68
69 RETURN = r'''
70 data:
71 description: Output from the C(Set-DbaSpn) or C(Remove-DbaSpn) function.
72 returned: success, but not in check_mode.
73 type: dict
74 '''