Debian Codegraph @

ansible_collections/lowlydba/sqlserver/plugins/modules/tcp_port.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: tcp_port
10 short_description: Sets the TCP port for the instance
11 description:
12 - Sets the TCP port for a SQL Server instance.
13 version_added: 0.10.0
14 options:
15 username:
16 description:
17 - Username for alternative credential to authenticate with Windows.
18 type: str
19 required: false
20 password:
21 description:
22 - Password for alternative credential to authenticate with Windows.
23 type: str
24 required: false
25 port:
26 description:
27 - Port for SQL Server to listen on.
28 type: int
29 required: true
30 ip_address:
31 description:
32 - IPv4 address.
33 type: str
34 required: false
35 force:
36 description:
37 - Restart SQL Server and SQL Agent services automatically.
38 type: bool
39 required: false
40 default: false
41 version_added: 1.2.0
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: Set the default port
53 lowlydba.sqlserver.tcp_port:
54 sql_instance: sql-01.myco.io
55 port: 1433
56
57 - name: Set a non-standard default port
58 lowlydba.sqlserver.tcp_port:
59 sql_instance: sql-01.myco.io
60 port: 1933
61 '''
62
63 RETURN = r'''
64 data:
65 description:
66 - Output from the C(Set-DbaTcpPort) function.
67 - RestartRequired returned if the change requires a service restart to take effect.
68 returned: success, but not in check_mode.
69 type: dict
70 '''