lowlydba.sqlserver.spn module – Configures SPNs for SQL Server
Note
This module is part of the lowlydba.sqlserver collection (version 2.7.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.spn.
New in lowlydba.sqlserver 0.6.0
Synopsis
- Configures SPNs for SQL Server. 
Requirements
The below requirements are needed on the host that executes this module.
- dbatools PowerShell module 
Parameters
| Parameter | Comments | 
|---|---|
| The host or alias to configure the SPN for. Can include the port in the format  | |
| Password of a credential to connect to Active Directory with. | |
| Username of a credential to connect to Active Directory with. | |
| The account you want the SPN added to. Will be looked up if not provided. | |
| Whether or not the object should be  Choices: 
 | 
Attributes
| Attribute | Support | Description | 
|---|---|---|
| Support: full | Can run in check_mode and return changed status prediction without modifying target. | |
| Platform: Windows | Target OS/families that can be operated against. | 
Examples
- name: Add server SPN
  lowlydba.sqlserver.spn:
    computer: sql-01.myco.io
    service_account: myco\sql-svc
- name: Create an AG Listener
  lowlydba.sqlserver.ag_listener:
    sql_instance_primary: sql-01.myco.io
    ag_name: AG_MyDatabase
    listener_name: aglMyDatabase
    ip_address:
      - 10.0.20.20
      - 10.1.77.77
    subnet_ip:
      - 255.255.252.0
    subnet_mask:
      - 255.255.255.0
- name: Add SPN for new AG listener on port 1433
  lowlydba.sqlserver.spn:
    computer: aglMyDatabase.myco.io:1433
    service_account: myco\sql-svc
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. | 
