Debian Codegraph @

ansible_collections/lowlydba/sqlserver/plugins/modules/credential.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: credential
10 short_description: Configures a credential on a SQL server
11 description:
12 - Creates, replaces, or removes a credential on a SQL server.
13 version_added: 1.3.0
14 options:
15 identity:
16 description:
17 - The Credential Identity.
18 type: str
19 required: true
20 name:
21 description:
22 - The Credential name.
23 type: str
24 required: false
25 password:
26 description:
27 - Password used to authenticate the Credential Identity.
28 type: str
29 required: false
30 mapped_class_type:
31 description:
32 - Sets the class associated with the credential.
33 type: str
34 required: false
35 choices: ['CryptographicProvider','None']
36 provider_name:
37 description:
38 - Specifies the cryptographic provider name for the Enterprise Key Management Provider.
39 type: str
40 required: false
41 force:
42 description:
43 - If this switch is enabled, the existing credential will be dropped and recreated.
44 type: bool
45 default: false
46 author:
47 - "Joe Krilov (@Joey40)"
48 - "John McCall (@lowlydba)"
49 requirements:
50 - L(dbatools,https://www.powershellgallery.com/packages/dbatools/) PowerShell module
51 extends_documentation_fragment:
52 - lowlydba.sqlserver.sql_credentials
53 - lowlydba.sqlserver.attributes.check_mode
54 - lowlydba.sqlserver.attributes.platform_all
55 - lowlydba.sqlserver.state
56 '''
57
58 EXAMPLES = r'''
59 - name: Create a credential with a password
60 lowlydba.sqlserver.credential:
61 sql_instance: sql-01.myco.io
62 identity: ad\\user
63 name: MyCredential
64 password : <Password>
65
66 - name: Replace an existing credential
67 lowlydba.sqlserver.credential:
68 sql_instance: sql-01.myco.io
69 identity: MyIdentity
70 force: true
71
72 - name: Create a credential using a SAS token for a backup URL
73 lowlydba.sqlserver.credential:
74 sql_instance: sql-01.myco.io
75 identity: SHARED ACCESS SIGNATURE
76 name: https://<azure storage account name>.blob.core.windows.net/<blob container>
77 password : <Shared Access Token>
78
79 - name: Remove a credential
80 lowlydba.sqlserver.credential:
81 sql_instance: sql-01.myco.io
82 identity: MyIdentity
83 state: absent
84 '''
85
86 RETURN = r'''
87 data:
88 description: Output from the C(New-DbaDbCredential), C(Get-DbaDbCredential), or C(Remove-DbaDbCredential) function.
89 returned: success, but not in check_mode.
90 type: dict
91 '''