-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcleanup_all.yml
53 lines (45 loc) · 1.44 KB
/
cleanup_all.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
- name: Cleanup leftovers
hosts: all
vars:
# delete_files:
# - "{{ ansible_user_dir }}/.golang/bin/x"
# - "{{ ansible_user_dir }}/.local/share/nvim/site/pack/x/y"
# - "{{ ansible_user_dir }}/.config/nnn/bookmarks/x"
# - "{{ ansible_user_dir }}/x"
# uninstall_apt:
# - pkg
# uninstall_brew:
# - pkg
# uninstall_pip:
# - pkg
# uninstall_vscode:
# - pkg
tasks:
- name: Delete files from list 'delete_files'
ansible.builtin.file:
path: "{{ item }}"
follow: false
state: absent
loop: "{{ delete_files }}"
when: delete_files is defined
- name: Uninstall packages from list 'uninstall_apt'
ansible.builtin.apt:
name: "{{ uninstall_apt }}"
state: absent
become: true
when: uninstall_apt is defined and ansible_distribution == "Ubuntu"
- name: Uninstall packages from list 'uninstall_brew'
community.general.homebrew:
name: "{{ uninstall_brew }}"
state: absent
when: uninstall_brew is defined
- name: Uninstall packages from list 'uninstall_pip'
ansible.builtin.pip:
name: "{{ uninstall_pip }}"
state: absent
when: uninstall_pip is defined
- name: Uninstall Visual Studio Code extensions
ansible.builtin.command:
cmd: code --uninstall-extension "{{ item }}"
loop: "{{ uninstall_vscode }}"
when: uninstall_vscode is defined