forked from crombeen/ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
/
desktop.yml
364 lines (342 loc) · 10.9 KB
/
desktop.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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
# Copyright 2016, Dag Wieers <[email protected]>
#
# This playbook configures the desktop (background, icons). It is intended to
# be used on newly installed systems. Or whenever this playbook changes.
# TODO: Group Policies: https://msdn.microsoft.com/en-us/library/ms815238.aspx
#- hosts: computerlokaal
# gather_facts: no
# tasks:
# - name: Clean up Downloads
# win_cleanup:
# downloads: yes
# system_temp: yes
# temp: yes
# user_temp: yes
- hosts: computers
tasks:
# - name: Install PinnedItem
# win_psmodule:
# name: Pinneditem
# - name: Unpin all apps
# win_shell: |
# Get-PinnedItem -Type StartMenu | Remove-PinnedItem
#
# Install-Module -Name PinnedItem
# become: yes
# vars:
# ansible_become_user: '{{ user }}'
# become_user: '{{ user }}'
# ansible_become_password: ''
# become_password: ''
#Get-PinnedItem -Type StartMenu | Where {$_.Name -eq 'Snipping Tool'} | Remove-PinnedItem
# - name: Clean up Downloads
# win_cleanup:
# items:
# - C:\Users\leerling\Downloads\*
# - C:\Windows\Temp\*
# system_prefetch: yes
# system_temp: yes
# user_downloads: yes
# user_temp: yes
# downloads: yes
# temp: yes
# tags: cleanup
# - name: Unpin all apps
# win_shell: |
# foreach ($item in (New-Object -Com Shell.Application).NameSpace('shell:::{4234d49b-0245-4df3-b780-3893943456e1}').Items()) {
# foreach ($verb in $item.Verbs()) {
# Write-Host "Verb $($verb.Name) -- App $($item.Name)"
# if ($verb.Name -match 'Van Start &losmaken|Van taa&kbalk losmaken') {
# $verb.DoIt()
# Write-Host "App $($item.Name) Verb $($verb.Name)"
# }
# }
# }
# function Unpin($app) {
# try {
# foreach ($item in (New-Object -Com Shell.Application).NameSpace('shell:::{4234d49b-0245-4df3-b780-3893943456e1}').Items()) {
# if ($item.Name -eq $app) {
# foreach ($verb in $item.Verbs()) {
# if ($verb.Name.replace('&','') -match 'Van "Start" losmaken|Von "Start" lösen|Unpin from Start') {
# $verb.DoIt()
# }
# }
# }
# }
# } catch {
# Write-Error "Error Pinning/Unpinning App! (App-Name correct?)"
# }
# }
#
# Unpin "Mail"
# Unpin "Store"
# Unpin "Calendar"
# Unpin "Microsoft Edge"
# Unpin "Photos"
# Unpin "Cortana"
# Unpin "Weather"
# Unpin "Phone Companion"
# Unpin "Twitter"
# Unpin "Skype Video"
# Unpin "Candy Crush Soda Saga"
# Unpin "xbox"
# Unpin "Groove music"
# Unpin "movies & tv"
# Unpin "microsoft solitaire collection"
# Unpin "money"
# Unpin "get office"
# Unpin "onenote"
# Unpin "news"
# become: yes
# vars:
# ansible_become_user: '{{ user }}'
# become_user: '{{ user }}'
# ansible_become_password: ''
# become_password: ''
# tags: tiles
- name: Add shortcut icons
win_copy:
src: files/icons/{{ item }}
dest: '%Public%\Pictures\{{ item }}'
with_items:
- bingel2.ico
- computermeester2.ico
- gmail2.ico
- iomniwize.ico
- kweetet3.ico
- scratch2.ico
- symbaloo2.ico
tags: icons
- name: Add default desktop shortcuts
win_shortcut:
description: '{{ item.desc }}'
src: '{{ ansible_env["ProgramFiles(x86)"] if "ProgramFiles(x86)" in ansible_env else ansible_env.ProgramFiles }}\Google\Chrome\Application\chrome.exe'
args: '--new-window {{ item.url }} {{ item.args|default("") }}'
dest: '{{ item.dest }}'
icon: '{{ item.icon | default(",0") }}'
windowstyle: '{{ item.windowstyle | default("normal") }}'
hotkey: '{{ item.hotkey | default(omit) }}'
state: present
with_items:
- desc: ComputerMeester website
url: http://computermeester.be/
dest: '%Public%\Desktop\Computer Meester.lnk'
icon: '%Public%\Pictures\computermeester2.ico,0'
windowstyle: maximized
# args: --start-fullscreen
- desc: Bingel website
url: https://www.bingel.be/bingel/login/
dest: '%Public%\Desktop\Bingel.lnk'
icon: '%Public%\Pictures\bingel2.ico,0'
windowstyle: maximized
- desc: Symbaloo website
url: https://www.symbaloo.com/
dest: '%Public%\Desktop\Symbaloo.lnk'
icon: '%Public%\Pictures\symbaloo2.ico,0'
windowstyle: maximized
hotkey: Ctrl+Alt+S
# args: --start-fullscreen
- desc: Scratch website
url: https://scratch.mit.edu/projects/editor/
dest: '%Public%\Desktop\Scratch.lnk'
icon: '%Public%\Pictures\scratch2.ico,0'
windowstyle: maximized
- desc: Kweetet website
url: https://www.kweetet.be/leerling
dest: '%Public%\Desktop\Kweetet.lnk'
icon: '%Public%\Pictures\kweetet3.ico,0'
windowstyle: maximized
tags: shortcuts
- name: Add shortcuts for all computers
win_shortcut:
desc: '{{ item.desc }}'
src: '{{ item.src }}'
dest: '{{ item.dest }}'
icon: '{{ item.icon|default(item.src ~ ",0") }}'
with_items:
- desc: Gedeelde ictadmin bestanden
src: \\diskstation01\ictadmin
dest: Desktop\ictadmin.lnk
icon: '%SystemRoot%\System32\imageres.dll,117'
- desc: Prullenbak
src: shell:RecycleBinFolder
dest: '%Public%\Desktop\Prullenbak.lnk'
icon: ',0'
- desc: Process Explorer
src: C:\ProgramData\chocolatey\bin\procexp.exe
dest: Desktop\Process Explorer.lnk
- desc: Autoruns
src: C:\ProgramData\chocolatey\bin\autoruns.exe
dest: Desktop\Autoruns.lnk
- desc: WakeMeOnLan
src: \\diskstation01\ictadmin\Tools\WakeMeOnLan\WakeMeOnLan.exe
dest: Desktop\WakeMeOnLan.lnk
ignore_errors: yes
tags: shortcuts
# - name: Disable Windows tiles for new users
# win_copy:
# src: LayoutModification.xml
# dest: C:\Users\ictadmin\AppData\Local\Microsoft\Windows\Shell\LayoutModification.xml
# tags: tiles
# We prefer to make the Administrator background bright red
- name: Set red background for user ictadmin
win_regedit:
path: '{{ item.path }}'
name: '{{ item.name }}'
data: '{{ item.data }}'
type: '{{ item.type }}'
with_items:
- path: HKCU:\Control Panel\Desktop
name: Wallpaper
data: ''
type: string
- path: HKCU:\Control Panel\Desktop
name: WallpaperStyle
data: 10
type: string
- path: HKCU:\Control Panel\Colors
name: Background
data: '232 17 35'
type: string
tags:
- bg
- ictadmin
- registry
- name: Remove unwanted desktop shortcuts
win_shortcut:
dest: '{{ item }}'
state: absent
with_items:
- C:\Users\{{ user }}\Desktop\WinDirStat.lnk
- '%Public%\Desktop\Audacity.lnk'
- '%Public%\Desktop\CDex.lnk'
- '%Public%\Desktop\Firefox.lnk'
- '%Public%\Desktop\Google Chrome.lnk'
- '%Public%\Desktop\Google Earth.lnk'
- '%Public%\Desktop\Inkscape.lnk'
- '%Public%\Desktop\Inkscape 0.92.1.lnk'
- '%Public%\Desktop\Inkscape 0.92.2.lnk'
# - '%Public%\Desktop\InfraRecorder.lnk'
# - '%Public%\Desktop\KeePass 2.lnk'
- '%Public%\Desktop\LibreOffice 5.1.lnk'
- '%Public%\Desktop\LibreOffice 5.2.lnk'
- '%Public%\Desktop\LibreOffice 5.3.lnk'
- '%Public%\Desktop\LibreOffice 5.4.lnk'
- '%Public%\Desktop\Mozilla Firefox.lnk'
- '%Public%\Desktop\VLC media player.lnk'
- '%Public%\Desktop\Google Drive File Stream.lnk'
tags:
- cleanup
- shortcuts
- hosts: computerlokaal:technieklokaal
tasks:
- name: Move files on Desktop to Documents
# win_shell: Move-Item %userprofile%\Desktop\*.* %userprofile%\Documents\ -Force
# become_user: leerling
win_shell: Move-Item C:\Users\leerling\Desktop\* C:\Users\leerling\Documents\ -Force
failed_when: no
tags:
- cleanup
- docs
- name: Add shortcuts
win_shortcut:
desc: '{{ item.desc }}'
src: '{{ item.src }}'
dest: '{{ item.dest }}'
icon: '{{ item.icon|default(item.src ~ ",0") }}'
with_items:
- desc: Mijn Documenten
src: '%UserProfile%\Documents'
dest: '%Public%\Desktop\Documenten.lnk'
icon: ',0'
ignore_errors: yes
tags:
- shares
- shortcuts
- hosts: klaslokaal:extra:beheer
tasks:
- name: Add Music/Video shortcuts
win_shortcut:
desc: '{{ item.desc }}'
src: '{{ item.src }}'
dest: '{{ item.dest }}'
icon: '%SystemRoot%\System32\imageres.dll,{{ item.idx }}'
with_items:
- desc: Gedeelde muziek bestanden
dest: '%Public%\Desktop\Muziek.lnk'
src: \\diskstation01\music
idx: 103
- desc: Gedeelde video bestanden
dest: '%Public%\Desktop\Video.lnk'
src: \\diskstation01\video
idx: 178
ignore_errors: yes
tags:
- shares
- shortcuts
- name: Remove shortcuts
win_shortcut:
dest: '{{ item.dest }}'
state: absent
with_items:
- dest: '%Public%\Desktop\Documenten.lnk'
tags:
- clean
- shares
- shortcuts
- hosts: klaslokaal:beheer
tasks:
- name: Add extra shortcuts
win_shortcut:
description: '{{ item.desc }}'
src: '{{ ansible_env["ProgramFiles(x86)"] if "ProgramFiles(x86)" in ansible_env else ansible_env.ProgramFiles }}\Google\Chrome\Application\chrome.exe'
args: '--new-window {{ item.url }} {{ item.args|default("") }}'
dest: '{{ item.dest }}'
icon: '{{ item.icon | default(",0") }}'
windowstyle: '{{ item.windowstyle | default("normal") }}'
hotkey: '{{ item.hotkey | default(omit) }}'
state: present
with_items:
- desc: iOmniwize
url: https://www.iomniwize.net/lpwebnew/lpUILogin.aspx
dest: '%Public%\Desktop\iOmniwize.lnk'
icon: '%Public%\Pictures\iomniwize.ico'
- desc: Mail Crombeen
url: http://mail.basisschoolcrombeen.be/
dest: '%Public%\Desktop\E-mail.lnk'
icon: '%Public%\Pictures\gmail2.ico'
tags:
- shortcuts
- shortcuts-klas
# - name: Add Google Drive
# win_shortcut:
# desc: '{{ item.desc }}'
# src: '{{ item.src }}'
# dest: '{{ item.dest }}'
# icon: '%SystemRoot%\System32\imageres.dll,{{ item.idx }}'
# with_items:
# - desc: Google Drive File Stream
# dest: '%Public%\Desktop\Google Drive File Stream.lnk'
# src: G:\
# idx: 217
# tags:
# - shortcuts
# - shortcuts-klas
# Add KeePass shortcut for all users on admin systems
- hosts: beheer
tasks:
- name: Add KeePass shortcuts
win_shortcut:
desc: KeePass Password Safe 2
dest: '%Public%\Desktop\KeePass 2.lnk'
src: C:\Program Files (x86)\KeePass Password Safe 2\KeePass.exe
tags: keepass
# Add KeePass shortcut for user ictadmin on all other systems
- hosts: computers:!beheer
tasks:
- name: Add KeePass shortcuts
win_shortcut:
desc: KeePass Password Safe 2
dest: Desktop\KeePass 2.lnk
src: C:\Program Files (x86)\KeePass Password Safe 2\KeePass.exe
tags: keepass