Skip to content

Commit 727e920

Browse files
committed
fix: Windows verification
1 parent d639135 commit 727e920

File tree

2 files changed

+29
-9
lines changed

2 files changed

+29
-9
lines changed

ansible/playbooks/verify.yml

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
hosts: localhost
44
gather_facts: true
55

6+
pre_tasks:
7+
- name: Set effective platform
8+
ansible.builtin.set_fact:
9+
effective_platform: "{{ 'windows' if ansible_env.WSL_DISTRO_NAME is defined else ansible_os_family | lower }}"
10+
611
vars:
712
tools_to_verify:
813
- { cmd: "git --version", name: "git" }
@@ -20,6 +25,18 @@
2025
- { cmd: "pnpm --version", name: "pnpm" }
2126

2227
windows_tools_to_verify:
28+
- { cmd: "git --version", name: "git" }
29+
- { cmd: "just --version", name: "just" }
30+
- { cmd: "fzf --version", name: "fzf" }
31+
- { cmd: "bat --version", name: "bat" }
32+
- { cmd: "eza --version", name: "eza" }
33+
- { cmd: "rg --version", name: "ripgrep" }
34+
- { cmd: "jq --version", name: "jq" }
35+
- { cmd: "starship --version", name: "starship" }
36+
- { cmd: "node --version", name: "node" }
37+
- { cmd: "python --version", name: "python" }
38+
- { cmd: "cargo --version", name: "cargo" }
39+
- { cmd: "pnpm --version", name: "pnpm" }
2340
- { cmd: "dotnet --version", name: "dotnet" }
2441
- { cmd: "dotnet --list-runtimes", name: "dotnet-runtimes" }
2542
- { cmd: "pwsh --version", name: "powershell" }
@@ -39,14 +56,17 @@
3956
label: "{{ item.name }}"
4057
register: verify_results
4158
changed_when: false
42-
failed_when: verify_results.rc != 0
59+
environment:
60+
PATH: "{{ ansible_env.HOME }}/.cargo/bin:{{ ansible_env.HOME }}/.local/share/mise/shims:{{ ansible_env.HOME }}/.local/bin:{{ ansible_env.PATH }}"
61+
when: effective_platform != "windows"
4362

4463
- name: Print verified versions
4564
ansible.builtin.debug:
4665
msg: "OK {{ item.item.name }}: {{ item.stdout_lines[0] }}"
4766
loop: "{{ verify_results.results }}"
4867
loop_control:
4968
label: "{{ item.item.name }}"
69+
when: effective_platform != "windows"
5070

5171
- name: Verify scripts are deployed and executable
5272
ansible.builtin.stat:
@@ -55,7 +75,7 @@
5575
loop:
5676
- ff
5777
- ll
58-
when: ansible_os_family != "Windows"
78+
when: effective_platform != "windows"
5979

6080
- name: Assert scripts are executable
6181
ansible.builtin.assert:
@@ -67,36 +87,35 @@
6787
loop: "{{ script_stats.results }}"
6888
loop_control:
6989
label: "{{ item.item }}"
70-
when: ansible_os_family != "Windows"
90+
when: effective_platform != "windows"
7191

7292
- name: Verify ll runs successfully
7393
ansible.builtin.command: "{{ ansible_env.HOME }}/.local/bin/ll ."
7494
changed_when: false
7595
register: ll_result
76-
when: ansible_os_family != "Windows"
96+
when: effective_platform != "windows"
7797

7898
- name: Print ll result
7999
ansible.builtin.debug:
80100
msg: "OK ll: listed {{ ll_result.stdout_lines | length }} lines"
81-
when: ansible_os_family != "Windows"
101+
when: effective_platform != "windows"
82102

83103
- name: Verify Windows tool is installed and functional
84-
ansible.builtin.command: "{{ item.cmd }}"
104+
ansible.builtin.shell: 'powershell.exe -NoProfile -Command "{{ item.cmd }}" 2>/dev/null' # noqa: risky-shell-pipe
85105
loop: "{{ windows_tools_to_verify }}"
86106
loop_control:
87107
label: "{{ item.name }}"
88108
register: windows_verify_results
89109
changed_when: false
90-
failed_when: windows_verify_results.rc != 0
91-
when: ansible_os_family == "Windows"
110+
when: effective_platform == "windows"
92111

93112
- name: Print verified Windows versions
94113
ansible.builtin.debug:
95114
msg: "OK {{ item.item.name }}: {{ item.stdout_lines[0] }}"
96115
loop: "{{ windows_verify_results.results }}"
97116
loop_control:
98117
label: "{{ item.item.name }}"
99-
when: ansible_os_family == "Windows"
118+
when: effective_platform == "windows"
100119

101120
- name: Reminder about git signing
102121
ansible.builtin.debug:

cspell.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
"esac",
5454
"eza",
5555
"Farlane",
56+
"fdfind",
5657
"flathub",
5758
"flatpak",
5859
"flatpakrepo",

0 commit comments

Comments
 (0)