Bug 2163709

Summary: Support integrating with AD Server for authentication
Product: Red Hat Enterprise Linux 9 Reporter: Sergei Petrosian <spetrosi>
Component: ansible-collection-microsoft-sqlAssignee: Sergei Petrosian <spetrosi>
Status: CLOSED ERRATA QA Contact: Daniel Yeisley <dyeisley>
Severity: unspecified Docs Contact: Alexandra Nikandrova <anikandr>
Priority: unspecified    
Version: 9.2CC: dyeisley, pasik
Target Milestone: rcKeywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ansible-collection-microsoft-sql-1.3.0-3.el9 Doc Type: Enhancement
Doc Text:
.Microsoft SQL Server Ansible role supports configuration of the Active Directory authentication With this update, the Microsoft SQL Ansible role supports configuration of the Active Directory authentication for an SQL Server. Now, you can configure the Active Directory authentication by setting variables with the `mssql_ad_` prefix.
Story Points: ---
Clone Of: 2163696 Environment:
Last Closed: 2023-05-09 07:53:38 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2163696    
Bug Blocks:    

Description Sergei Petrosian 2023-01-24 10:33:45 UTC
+++ This bug was initially created as a clone of Bug #2163696 +++

Description of problem:
SQL Server on linux supports configuring Windows Active Directory authentication for SQL Server on Linux. The automation of this functionality must be added to the role

Version-Release number of selected component (if applicable):
8.8

Steps to Reproduce:
1. Configure Windows AD Server and ensure AD Server and linux server meet all the prerequisites in https://learn.microsoft.com/en-us/sql/linux/sql-server-linux-active-directory-join-domain?view=sql-server-ver15#prerequisites 
2. Run the role against linux node with a playbook as such:

```
- name: Configure with AD server authentication
  hosts: all
  vars:
    mssql_accept_microsoft_odbc_driver_17_for_sql_server_eula: true
    mssql_accept_microsoft_cli_utilities_for_sql_server_eula: true
    mssql_accept_microsoft_sql_server_standard_eula: true
    mssql_version: 2022
    mssql_password: "p@55w0rD"
    mssql_edition: Evaluation
    mssql_manage_firewall: true
    mssql_ad_configure: true
    mssql_ad_sql_username: sqluser
    mssql_ad_sql_password: "p@55w0rD1"
    ad_integration_realm: domain.com
    ad_integration_password: Secret123
    ad_integration_user: Administrator
```

Expected results:
Integration with Active directory is configured and authentication with the following steps works:

1. SSH into the sqluser account:
# sshpass -e ssh -l sqluser clinet.domain.com
2. Kinit as Administrator user:
# kinit Administrator
3. Verify that authentication works:
# /opt/mssql-tools/bin/sqlcmd -S. -Q 'SELECT SYSTEM_USER'"

Additional info:
Upstream PR: https://github.com/linux-system-roles/mssql/pull/159

Comment 10 errata-xmlrpc 2023-05-09 07:53:38 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (ansible-collection-microsoft-sql bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2023:2411