Debian Codegraph @

ansible_collections/lowlydba/sqlserver/plugins/modules/first_responder_kit.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: first_responder_kit
10 short_description: Install/update the First Responder Kit scripts
11 description:
12 - A wrapper for C(Install-DbaFirstResponderKit) to fetch the latest version of the scripts, or install from a local cached version.
13 version_added: 0.10.0
14 options:
15 local_file:
16 description:
17 - Specifies the path to a local file to install FRK from. This should be the zip file as distributed by the maintainers.
18 - If this option is not specified, the latest version will be downloaded and installed Github.
19 type: str
20 required: false
21 only_script:
22 description:
23 - Specifies the name(s) of the script(s) to run for installation. Wildcards are permitted.
24 - This way only part of the First Responder Kit can be installed.
25 type: str
26 required: false
27 default: 'Install-All-Scripts.sql'
28 choices: ['Install-All-Scripts.sql',
29 'Install-Core-Blitz-No-Query-Store.sql',
30 'Install-Core-Blitz-With-Query-Store.sql',
31 'sp_Blitz.sql',
32 'sp_BlitzFirst.sql',
33 'sp_BlitzIndex.sql',
34 'sp_BlitzCache.sql',
35 'sp_BlitzWho.sql',
36 'sp_BlitzQueryStore.sql',
37 'sp_BlitzAnalysis.sql',
38 'sp_BlitzBackups.sql',
39 'sp_BlitzInMemoryOLTP.sql',
40 'sp_BlitzLock.sql',
41 'sp_AllNightLog.sql',
42 'sp_AllNightLog_Setup.sql',
43 'sp_DatabaseRestore.sql',
44 'sp_ineachdb.sql',
45 'SqlServerVersions.sql',
46 'Uninstall.sql']
47 branch:
48 description:
49 - Specifies an alternate branch of the First Responder Kit to install.
50 type: str
51 required: false
52 choices: ['main', 'dev']
53 database:
54 description:
55 - Name of the target database.
56 type: str
57 required: true
58 force:
59 description:
60 - If this switch is enabled, the FRK will be downloaded from the internet even if previously cached.
61 type: bool
62 default: false
63 author: "John McCall (@lowlydba)"
64 requirements:
65 - L(dbatools,https://www.powershellgallery.com/packages/dbatools/) PowerShell module
66 extends_documentation_fragment:
67 - lowlydba.sqlserver.sql_credentials
68 - lowlydba.sqlserver.attributes.check_mode
69 - lowlydba.sqlserver.attributes.platform_all
70 '''
71
72 EXAMPLES = r'''
73 - name: Install FRK
74 lowlydba.sqlserver.first_responder_kit:
75 sql_instance: test-server.my.company.com
76 database: dba_tools
77 '''
78
79 RETURN = r'''
80 data:
81 description: Modified output from the C(Install-DbaFirstResponderKit) function.
82 returned: success, but not in check_mode.
83 type: dict
84 '''