lowlydba.sqlserver.availability_group module – Configures availability group(s)
Note
This module is part of the lowlydba.sqlserver collection (version 3.1.0).
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.availability_group.
New in lowlydba.sqlserver 0.4.0
Synopsis
Configures SQL Server Availability Group(s) with up to one replica.
When the availability group already exists, only automated_backup_preference, cluster_type, dtc_support_enabled, basic_availability_group, database_health_trigger, is_distributed_ag, failure_condition_level and healthcheck_timeout are reconciled. All other options apply only when the availability group is created.
Requirements
The below requirements are needed on the host that executes this module.
dbatools PowerShell module
Parameters
Parameter |
Comments |
|---|---|
Name of the Availability Group. |
|
Apply changes to all availability groups on the instance. Only used for configuring existing availability groups. Choices:
|
|
Allow taking a full backup to Choices:
|
|
How to handle backup requests by default. Choices:
|
|
Whether the replica should be Asynchronous or Synchronous. Only used when creating a new availability group. Choices:
|
|
Indicates whether the availability group is Basic Availability Group. Choices:
|
|
Cluster type of the Availability Group. Only supported in SQL Server 2017 and above. Choices:
|
|
Indicates whether the availability group is Contained. Requires DBATools >= 2.1.15 Only used when creating a new availability group. Choices:
|
|
Name of the database to create the Availability Group for. Only used when creating a new availability group. |
|
Indicates whether the availability group triggers the database health. Choices:
|
|
Enables Dtc support. Choices:
|
|
Whether the replica have Automatic or Manual failover. Only used when creating a new availability group. Choices:
|
|
Specifies the different conditions that can trigger an automatic failover in Availability Group. Choices:
|
|
Drop and recreate the database on remote servers using fresh backup. Only used when creating a new availability group. Choices:
|
|
This setting used to specify the length of time, in milliseconds, that the SQL Server resource DLL should wait for information returned by the Changes that are made to the timeout settings are effective immediately and do not require a restart of the SQL Server resource. |
|
Indicates whether the availability group is distributed. Choices:
|
|
Default seeding mode for the replica. Should remain as the default otherwise manual setup may be required. Only used when creating a new availability group. Choices:
|
|
The network share where the backups will be backed up and restored from. Only used when creating a new availability group with seeding_mode=Manual. |
|
The SQL Server instance to modify. |
|
The secondary SQL Server instance for the new Availability Group. Only used when creating a new availability group. |
|
Password for SQL Authentication. |
|
Password for SQL Authentication for the secondary replica. |
|
Username for SQL Authentication. |
|
Username for SQL Authentication for the secondary replica. |
|
Whether or not the object should be Choices:
|
|
Use the last full and log backup of database. A log backup must be the last backup. Only used when creating a new availability group. 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 an availability group
lowlydba.sqlserver.availability_group:
sql_instance: sql01.example.com
ag_name: AG_App
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
Output from the Returned: success, but not in check_mode. |