Skip to content

fix: Update SSMS installation path check for v22 - #507

Open
daaash1234 wants to merge 1 commit into
Orange-Cyberdefense:mainfrom
daaash1234:fix/mssql-ssms-path
Open

fix: Update SSMS installation path check for v22#507
daaash1234 wants to merge 1 commit into
Orange-Cyberdefense:mainfrom
daaash1234:fix/mssql-ssms-path

Conversation

@daaash1234

Copy link
Copy Markdown

Summary

The check SSMS installation already done task in the mssql_ssms role checks a hardcoded path that only matches SSMS 18 (C:\Program Files (x86)\Microsoft SQL Server Management Studio 18). Newer SSMS releases (e.g. SSMS 22) install as a 64-bit application under C:\Program Files\... with a different version-numbered folder name.

Because the win_stat check never finds a match when a newer SSMS version is installed, ssms_installation.stat.exists is always false, causing the Install SSMS task to
run (or re-run) every time the playbook executes — even when SSMS is already installed.

Problem this causes

  • Install SSMS runs via win_command (SSMS_installer.exe /install /quiet /norestart), which is executed over WinRM in a non-interactive session.
  • The SSMS bootstrapper can show a hidden dialog (e.g. process/lock confirmation) even with /quiet, which has no desktop to render to over WinRM — this causes the task to
    hang indefinitely with no CPU/network activity.
  • Since the idempotency check never succeeds, this hang can recur on every playbook re-run (e.g. after a WinRM disconnect triggers Ansible's automatic playbook retry).

Fix

Update the win_stat path check to match the actual install location for the current SSMS version:

- name: check SSMS installation already done
  win_stat:
    path: "C:\\Program Files\\Microsoft SQL Server Management Studio 22"
  register: ssms_installation

Testing

  • Manually installed SSMS 22 via the VM console (interactive session) to unblock a stuck Install SSMS task during provisioning.
  • Re-ran servers.yml after the path fix; ssms_installation.stat.exists now correctly evaluates to true, and both Install SSMS and Reboot after install are skipped as expected.
  • Provisioning completed successfully end-to-end afterward.

Notes for maintainers

This is a minimal, version-specific fix. A more robust long-term approach might check for multiple known SSMS install paths/versions, but that's out of scope for this fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant