lowlydba.sqlserver.user module – Configures a user within a database
Note
This module is part of the lowlydba.sqlserver collection (version 1.1.2).
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.user
.
New in lowlydba.sqlserver 1.1.0
Synopsis
Creates, modifies, or removes a user in a database.
Requirements
The below requirements are needed on the host that executes this module.
dbatools PowerShell module
Parameters
Parameter |
Comments |
---|---|
Database for the user. |
|
The default database schema for the user. Default: |
|
Specifies that the user is for Azure AD Authentication. Only used when creating a new user, this cannot be modified for an existing user. Choices:
|
|
Name of the login that the user is mapped to. |
|
The SQL Server instance to modify. |
|
Password for SQL Authentication. |
|
Username for SQL Authentication. |
|
Whether or not the object should be Choices:
|
|
Name of the user. |
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 a user
lowlydba.sqlserver.user:
sql_instance: sql-01.myco.io
login: TheIntern
username: TheIntern
database: InternProject1
- name: Change user's schema
lowlydba.sqlserver.login:
sql_instance: sql-01.myco.io
login: TheIntern
username: TheIntern
database: InternProject1
default_schema: dev
- name: Remove a user
lowlydba.sqlserver.login:
sql_instance: sql-01.myco.io
login: TheIntern
username: TheIntern
database: InternProject1
state: absent
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. |