-
Notifications
You must be signed in to change notification settings - Fork 50
/
core.yaml
112 lines (96 loc) · 2.48 KB
/
core.yaml
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
- name: Core OS packages
hosts: 127.0.0.1
connection: local
tasks:
- set_fact: is_wsl={{ lookup('file', '/proc/version') is regex('(M|m)icrosoft') }}
- name: Disable auto-upgrade timer
become: yes
command:
cmd: systemctl disable {{ item }}.timer
removes: /etc/systemd/system/timers.target.wants/{{ item }}.timer
loop:
- apt-daily
- apt-daily-upgrade
- name: Create ~/bin
file:
path: ~/bin
state: directory
mode: 0700
- name: Add ~/bin to PATH
lineinfile:
path: ~/.bashrc
line: export PATH=$PATH:~/bin
- name: Enable HTTPS APT support
become: yes
apt:
name: "{{ packages }}"
vars:
packages:
- apt-transport-https
- ca-certificates
- gnupg-agent
- software-properties-common
- name: Update APT package list
become: yes
apt:
update_cache: yes
register: apt_update
retries: 5
until: apt_update is success
- name: Upgrade to latest APT packages
become: yes
apt:
upgrade: "yes"
- name: Install core packages
become: yes
apt:
package: "{{ item }}"
loop:
- curl
- dconf-editor
- exfat-fuse
- htop
- inetutils-traceroute
- jq
- net-tools
- p7zip-full
- unzip
- uuid
- xclip
- name: "Install exfatprogs"
become: yes
apt:
package: exfatprogs
- name: "[Non-WSL] Install Gnome Extension Manager"
become: yes
apt:
package: gnome-shell-extension-manager
when: not is_wsl
- name: "[Non-WSL] Install snapd"
become: yes
apt:
package: snapd
when: not is_wsl
- name: "[Non-WSL] Install snap core"
become: yes
command: snap install core
args:
creates: /snap/core/current/bin/bash
when: not is_wsl
- name: "[Non-WSL] Add /snap/bin to PATH"
lineinfile:
path: ~/.bashrc
line: export PATH=$PATH:/snap/bin
when: not is_wsl
- name: Get installed package list
package_facts: {}
- name: Add dm-crypt to /etc/initramfs-tools/modules
become: yes
lineinfile:
path: /etc/initramfs-tools/modules
line: dm-crypt
when: ansible_facts.packages["cryptsetup-initramfs"] is defined
- name: Ensure ~/.hushlogin exists
file:
path: ~/.hushlogin
state: touch