From b6a0d4e737d56d595007cee64f7553fdfc1963ab Mon Sep 17 00:00:00 2001 From: Fabio Scotto di Santolo Date: Thu, 2 Apr 2026 14:22:19 +0200 Subject: [PATCH] Remove redundant WSL check from Windows role --- .../tasks/main.yml | 24 ------------------- 1 file changed, 24 deletions(-) diff --git a/ansible/roles/profile_workstation_host_windows/tasks/main.yml b/ansible/roles/profile_workstation_host_windows/tasks/main.yml index 3d8dce1..a28be3f 100644 --- a/ansible/roles/profile_workstation_host_windows/tasks/main.yml +++ b/ansible/roles/profile_workstation_host_windows/tasks/main.yml @@ -35,30 +35,6 @@ $Ansible.Changed = $true -- name: Check whether target WSL distribution exists - tags: [packages, services, wsl] - ansible.windows.win_powershell: - script: | - $distributions = @(wsl --list --quiet) | ForEach-Object { $_.Trim() } | Where-Object { $_ -ne '' } - $ubuntuDistribution = $distributions | Where-Object { $_ -like '{{ windows_wsl_distribution_name }}*' } | Select-Object -First 1 - if ($null -ne $ubuntuDistribution) { - $Ansible.Result = @{ exists = $true; distribution = $ubuntuDistribution } - $Ansible.Changed = $false - return - } - - $Ansible.Result = @{ exists = $false; distribution = $null } - $Ansible.Changed = $false - register: windows_wsl_distribution_state - -- name: Fail when target WSL distribution is missing - tags: [packages, services, wsl] - ansible.builtin.fail: - msg: >- - No WSL Ubuntu distribution matching {{ windows_wsl_distribution_name }}* is installed on the Windows host. - Run scripts/bootstrap_windows_workstation.ps1 first and launch the distro once before applying the Windows play. - when: not (windows_wsl_distribution_state.result.exists | default(false)) - - name: Install Windows workstation applications with winget tags: [packages] ansible.windows.win_powershell: