-
Notifications
You must be signed in to change notification settings - Fork 0
/
main-Windows.yml
124 lines (113 loc) · 3.46 KB
/
main-Windows.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
---
- name: Update PATH
hosts: win
gather_facts: no
become_user: "{{ blueprint_user }}"
become_method: runas
become: yes
tasks:
- name: Add a directory to the user PATH
ansible.windows.win_environment:
name: PATH
state: present
value: "{{ custom_path }}"
level: user
tags:
- always
- name: Install Packages
hosts: win
gather_facts: no
become_user: "{{ blueprint_user }}"
become: yes
become_method: runas
tasks:
- name: Install WinGet packages
ansible.windows.win_shell: |
winget install --accept-source-agreements --accept-package-agreements --disable-interactivity --uninstall-previous -e --id {{ item }}
ignore_errors: yes
with_items: "{{ winget_packages }}"
register: result
failed_when:
- result.rc != 0
- '"No newer package versions are available from the configured sources." not in result.stdout'
changed_when:
- result.rc == 0
tags:
- winget
- name: Upgrade existing WinGet packages
ansible.windows.win_shell: |
winget upgrade --all --accept-source-agreements --accept-package-agreements --disable-interactivity
tags:
- never
- upgrade
- name: Uninstall Windows web experience
ansible.windows.win_shell: |
winget uninstall --id {{ item }} --disable-interactivity
when: ansible_os_family == "Windows"
register: result
with_items: "{{ winget_packages_autoremove }}"
failed_when:
- result.rc != 0
- '"No installed package found matching input criteria." not in result.stdout'
changed_when:
- result.rc == 0
- '"No installed package found matching input criteria." not in result.stdout'
tags:
- never
- autoremove
- name: Install common Go packages for Windows
ansible.windows.win_shell: |
go install -ldflags="-s -w" {{ item }}
environment:
CGO_ENABLED: 1
CC: clang
with_items: "{{ common_go_packages }}"
tags:
- go
- name: Install common Node packages
ansible.windows.win_powershell:
script: npm install -g {{ item }}
with_items: "{{ common_node_packages }}"
tags:
- node
- name: Update rustup
ansible.windows.win_shell: |
rustup update
tags:
- rustup
- never
- upgrade
- name: Update rustup
ansible.windows.win_shell: |
C:\msys64\usr\bin\bash -lc "pacman --noconfirm -yS {{ item }}"
loop: "{{ pacman_packages }}"
tags:
- pacman
- never
- name: Install common Cargo packages
ansible.windows.win_shell: |
& '{{ cargo_cmd }}' install {{ item }}
loop: "{{ common_cargo_packages }}"
tags:
- cargo
environment:
CARGO_HOME: "{{ blueprint_user_home }}/.cargo"
- name: Install Windows specific Cargo packages
ansible.windows.win_shell: |
& '{{ cargo_cmd }}' install {{ item }}
loop: "{{ cargo_packages | default ([]) }}"
tags:
- cargo
environment:
CARGO_HOME: "{{ blueprint_user_home }}/.cargo"
- name: Disable Beep via Windows Registry
win_regedit :
path: 'HKLM:\SYSTEM\CurrentControlSet\Services\Beep'
name: Start
type: dword
data: 4
tags:
- regedit
environment:
LD_LIBRARY_PATH: "{{ blueprint_user_home }}/.pyenv/versions/3.12.0/lib/"
PATH: "{{ custom_path }}"