lowlydba.sqlserver.backup module – Performs a backup operation
Note
This module is part of the lowlydba.sqlserver collection (version 1.2.0).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install lowlydba.sqlserver
.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: lowlydba.sqlserver.backup
.
New in lowlydba.sqlserver 0.8.0
Synopsis
Performs any type of database backup operation.
Requirements
The below requirements are needed on the host that executes this module.
dbatools PowerShell module
Parameters
Parameter |
Comments |
---|---|
The URL to the base container of an Azure Storage account to write backups to. |
|
The name of the credential on the SQL instance that can write to the azure_base_url, only needed if using Storage access keys If using SAS credentials, the command will look for a credential with a name matching the azure_base_url. |
|
Specifies block size to use. Choices:
|
|
Number of I/O buffers to use. Default: |
|
By default this command will not attempt to create missing paths, this switch will change the behaviour so that it will. Choices:
|
|
If set, the backup checksum will be calculated. Choices:
|
|
If set, use compression when creating the backup if it is supported by the version and edition. Choices:
|
|
The backup will be CopyOnly. Choices:
|
|
If set, database is backed up to its own subfolder within the path. Choices:
|
|
The database to process. |
|
Specifies the Encryption Algorithm to used. Choices:
|
|
The name of the certificate to be used to encrypt the backups. |
|
The number of striped files to create the backup with. Default: |
|
The name of the file to backup to. If no name is specified then the backup files will be named |
|
If set, stops the function from checking path validity. Choices:
|
|
If set, this will prefix backup files with an incrementing integer (ie; Using this has been alleged to improved restore times on some Azure based SQL Database platforms. Choices:
|
|
Initializes the media as part of the backup operation. Choices:
|
|
Sets the size of the unit of transfer. Values must be a multiple of 64kb. Default: |
|
If set, performs a tail log backup. Choices:
|
|
Path in which to place the backup files. If not specified, the backups will be placed in the default backup location for SqlInstance. |
|
If set, the following list of strings will be replaced in the FilePath and Path strings. Choices:
|
|
The SQL Server instance to modify. |
|
Password for SQL Authentication. |
|
Username for SQL Authentication. |
|
By default the command timestamps backups using the format |
|
The type of backup to perform. Choices:
|
|
If set, the backup will be verified via Choices:
|
|
Formats the media as the first step of the backup operation. Choices:
|
Attributes
Attribute |
Support |
Description |
---|---|---|
Support: full |
Can run in check_mode and return changed status prediction without modifying target. |
|
Platforms: all |
Target OS/families that can be operated against. |
Examples
- name: Create striped full database backup in default dir
lowlydba.sqlserver.backup:
sql_instance: sql-01.myco.io
database: LowlyDB
type: full
file_count: 8
- name: Create t-log backup
lowlydba.sqlserver.backup:
sql_instance: sql-01.myco.io
database: LowlyDB
type: log
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Modified output from the Returned: success, but not in check_mode. |