lowlydba.sqlserver.traceflag module – Enable or disable global trace flags on a SQL Server instance

Note

This module is part of the lowlydba.sqlserver collection (version 2.2.2).

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.traceflag.

New in lowlydba.sqlserver 0.1.0

Synopsis

  • Enable\Disable global trace flag on a SQL Instance. This trace flag takes affect immediately and does not require SQL Instance restart.

  • This setting does not persist after restart.

Requirements

The below requirements are needed on the host that executes this module.

Parameters

Parameter

Comments

enabled

boolean / required

Flag to enable or disable the trace flag.

Choices:

  • false

  • true

sql_instance

string / required

The SQL Server instance to modify.

sql_password

string

Password for SQL Authentication.

sql_username

string

Username for SQL Authentication.

trace_flag

integer / required

Trace Flag number.

Attributes

Attribute

Support

Description

check_mode

Support: full

Can run in check_mode and return changed status prediction without modifying target.

platform

Platforms: all

Target OS/families that can be operated against.

Examples

- name: Eliminate successful backup information from SQL Error Log
  lowlydba.sqlserver.traceflag:
    sql_instance: sql-01.myco.io
    trace_flag: 3226
    enabled: true

- name: Disable trace flag
  lowlydba.sqlserver.traceflag:
    sql_instance: sql-01.myco.io
    trace_flag: 3226
    enabled: false

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

data

dictionary

Output from the Enable-DbaTraceFlag or Disable-DbaTraceFlag function.

Returned: success, but not in check_mode.

Authors

  • Sudhir Koduri (@kodurisudhir)