-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeclutter.yml
80 lines (68 loc) · 2.85 KB
/
declutter.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
---
- name: Declutter Windows
hosts: all
tasks:
- name: Check if Cortana is installed
ansible.windows.win_shell: "Get-AppxPackage -Name Microsoft.549981C3F5F10"
register: cortana_info
changed_when: false
- name: Ensure Cortana is uninstalled
ansible.windows.win_shell: "Get-AppxPackage -Name Microsoft.549981C3F5F10 | Remove-AppxPackage"
failed_when: false
when: "'Name' in cortana_info.stdout"
- name: 'Remove "News and Interests" from taskbar'
ansible.windows.win_regedit:
path: "HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Feeds"
name: "ShellFeedsTaskbarViewMode"
data: 2
type: "dword"
- name: Check if One Drive is installed
ansible.windows.win_reg_stat:
path: "HKCR:\\Wow6432Node\\CLSID\\{018D5C66-4533-4307-9B53-224DE2ED1FE6}"
register: one_drive_info
# Source: https://github.com/oatakan/ansible-role-windows_template_build/blob/master/tasks/remove-onedrive.yml
- name: Ensure Onedrive is uninstalled
when: one_drive_info.exists
block:
- name: Kill onedrive process
ansible.windows.win_shell: Stop-Process -Name OneDrive
ignore_errors: true
- name: Uninstall onedrive
ansible.windows.win_shell: 'C:/Windows/SysWOW64/OneDriveSetup.exe /uninstall'
- name: Remove onedrivesync package
ansible.windows.win_shell: get-appxpackage *Microsoft.OneDriveSync* | remove-appxpackage -AllUsers
- name: Remove onedrive directories
ansible.windows.win_file:
path: '{{ item }}'
state: absent
loop:
- 'C:/Users/{{ username }}/OneDrive'
- 'C:/Users/{{ username }}/AppData/Local/Microsoft/OneDrive'
- 'C:/ProgramData\Microsoft OneDrive'
- C:/OneDriveTemp
- name: Delete onedrive registry keys
ansible.windows.win_regedit:
path: '{{ item }}'
state: absent
delete_key: true
loop:
- HKCR:\\CLSID\\{018D5C66-4533-4307-9B53-224DE2ED1FE6}
- HKCR:\\Wow6432Node\\CLSID\\{018D5C66-4533-4307-9B53-224DE2ED1FE6}
- name: Ensure Teams 'Talk now' is removed
ansible.windows.win_regedit:
path: "HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer"
name: "HideSCAMeetNow"
data: 1
type: "dword"
- name: Ensure Checkboxes from Explorer and Desktop are removed
ansible.windows.win_regedit:
path: "HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced"
name: "AutoCheckSelect"
data: 0
type: "dword"
- name: Ensure dark mode
ansible.windows.win_regedit:
path: "HKCU:\\Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"
name: "AppsUseLightTheme"
data: "0"
type: "dword"