-
Notifications
You must be signed in to change notification settings - Fork 0
/
fedora.yml
353 lines (349 loc) · 10.7 KB
/
fedora.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
---
# This is an Ansible playbook.
# Run it with: ansible-playbook -K <THIS-FILE>
# Last updated for Fedora 31.
- hosts: localhost
vars:
home: "{{ ansible_env.HOME }}"
tasks:
- name: Upgrade all packages
become: true
tags: [sudo]
dnf:
name: "*"
state: latest
- name: Setup hostname
vars:
desired_hostname: zal
hostname_path: /etc/hostname
when: ansible_env.HOSTNAME != desired_hostname
block:
- hostname:
name: "{{desired_hostname}}"
become: true
tags: [sudo]
- shell: "echo {{desired_hostname}} >{{hostname_path}}"
when: lookup('file', hostname_path) != desired_hostname
become: true
tags: [sudo]
- name: Install basic tooling
become: true
tags: [sudo]
package:
state: present
name:
- asciinema
- bat
- chrome-gnome-shell
- colordiff
- dnf-plugins-core
- exa
- fd-find
- fish
- flameshot
- fzf
- gnome-tweaks
- google-roboto-fonts
- gparted
- graphviz
- htop
- hub
- jq
- levien-inconsolata-fonts
- libheif # for $ heif-convert IMG.heic IMG.jpg
- linux-libertine-fonts
- make
- most
- neovim
- python3-neovim
- ripgrep
- ruby-devel
- tmux
- tokei
- units
- xclip
- yamllint
- name: Neovim Plugins
tags: [vim]
vars:
site: "{{ home }}/.local/share/nvim/site"
block:
- file:
path: "{{ site }}"
state: directory
- git:
repo: [email protected]:thilp/nvim-plugins.git
dest: "{{ site }}/pack"
track_submodules: true
- name: Alacritty
become: true
tags: [sudo, alacritty]
block:
- command:
cmd: "dnf copr enable pschyska/alacritty"
stdin: "y"
warn: false
creates: /etc/yum.repos.d/_copr:copr.fedorainfracloud.org:pschyska:alacritty.repo
- package:
state: present
name: alacritty
- name: Python
tags:
- python
block:
- name: Install Python
become: true
tags: [sudo]
package:
state: present
name:
- python3
- autoconf
- bzip2
- bzip2-devel
- libffi-devel
- libtool
- lldb
- openssl-devel
- python-lldb
- python-devel
- python3-devel
- python3-pip
- readline
- readline-devel
- sqlite-devel
- zlib-devel
- name: Install Pyenv
git:
repo: https://github.com/pyenv/pyenv.git
dest: "{{home}}/.pyenv"
- name: Install Java
become: true
tags: [sudo]
package:
state: present
name:
- java-latest-openjdk-headless
- java-latest-openjdk-devel
- java-latest-openjdk-src
- java-latest-openjdk-javadoc
- name: VSCode
block:
- name: Install the VSCode repository
become: true
tags: [sudo]
yum_repository:
name: vscode
description: Visual Studio Code
baseurl: https://packages.microsoft.com/yumrepos/vscode
enabled: true
gpgcheck: true
gpgkey: https://packages.microsoft.com/keys/microsoft.asc
- name: Install VSCode
become: true
tags: [sudo]
package:
state: present
name: code
- name: Docker
tags:
- docker
block:
- name: Ask whether Docker is already installed
command: which docker
register: which_docker
changed_when: false
failed_when: false
- when: which_docker.rc != 0
block:
- name: Download & install Docker
become: true
tags: [sudo]
shell: curl -fsSL get.docker.com | CHANNEL=test sh
- name: Add me in the docker group
become: true
tags: [sudo]
user:
name: "{{ lookup('env', 'USER') }}"
groups: [docker]
append: true
- name: Enable & start Docker with systemd
become: true
tags: [sudo]
systemd:
name: docker
state: started
enabled: true
- name: Jetbrains IDEs
tags:
- jetbrains
block:
- name: Increase inotify watch limit
become: true
tags: [sudo]
sysctl:
name: fs.inotify.max_user_watches
value: "524288"
sysctl_file: /etc/sysctl.d/jetbrains.conf
reload: true
- vars:
tb_exe: "{{home}}/.local/share/JetBrains/Toolbox/bin/jetbrains-toolbox"
archive_path: /tmp/jetbrains_toolbox.tar.gz
when: tb_exe is not exists
block:
- name: Download Jetbrains Toolbox
vars:
tb_json: "{{ lookup('url', 'https://data.services.jetbrains.com/products/releases?code=TBA&latest=true&type=release') | from_json }}"
tb_url: "{{ tb_json | json_query('TBA[0].downloads.linux.link') }}"
# tb_checksum_url: "{{ tb_json | json_query('TBA[0].downloads.linux.checksumLink') }}"
get_url:
url: "{{ tb_url }}"
# checksum: "sha256:{{ tb_checksum_url }}"
dest: "{{ archive_path }}"
- name: Create temporary directory
tempfile:
state: directory
suffix: jetbrains
register: extracted_path
- name: Install Jetbrains Toolbox
unarchive:
remote_src: true
src: "{{ archive_path }}"
dest: "{{ extracted_path }}"
- name: Locate the Jetbrains Toolbox executable
find:
paths: "{{ extracted_path }}"
patterns: jetbrains-toolbox
recurse: true
register: find_toolbox
- name: Execute the Jetbrains Toolbox executable for the user
command: "{{ find_toolbox.files[0].path }} "
- debug:
msg: The toolbox should be open. If not, try opening it
manually at {{ find_toolbox.files[0].path }}.
Waiting until {{ tb_exe }} has been created ...
- wait_for:
path: "{{ tb_exe }}"
msg: Timeout while waiting for {{ tb_exe }}. Please install manually.
- name: Golang
tags:
- go
- golang
- languages
vars:
version: 1.13.4
goroot: "{{home}}/.golang"
dl_url: "https://dl.google.com/go/go{{version}}.linux-amd64.tar.gz"
tmp_archive: /tmp/golang.tar.gz
tmp_dir: /tmp/golang
when: ( goroot is not exists ) or
( lookup('file', goroot ~ "/VERSION") != "go" ~ version )
block:
- name: Download the latest Golang archive
when: tmp_archive is not exists
get_url:
url: "{{dl_url}}"
dest: "{{tmp_archive}}"
checksum: "sha256:{{ lookup('url', dl_url ~ '.sha256') }}"
- name: Create temporary directory for extraction of the Golang archive
tempfile:
state: directory
suffix: golang
register: tmp_dir
- name: Extract the latest Golang archive into the temporary directory
unarchive:
remote_src: true
src: "{{tmp_archive}}"
dest: "{{ tmp_dir.path }}"
- name: Remove the existing $GOROOT
file:
path: "{{goroot}}"
state: absent
- name: Populate $GOROOT
command: "mv {{ tmp_dir.path }}/go {{goroot}}"
- name: staticcheck
tags:
- go
- golang
- linter
command:
cmd: go get honnef.co/go/tools/cmd/staticcheck
creates: "{{ home }}/go/bin/staticcheck"
- name: Vivaldi
become: true
tags: [sudo]
block:
- name: Install the Vivaldi repository
yum_repository:
name: vivaldi
description: The Vivaldi Web Browser
enabled: true
baseurl: https://repo.vivaldi.com/archive/rpm/$basearch
gpgcheck: true
gpgkey: https://repo.vivaldi.com/archive/linux_signing_key.pub
- name: Install the Vivaldi package
package:
name: vivaldi-stable
state: present
- name: char command
vars:
repo: "{{home}}/git/unicli"
fish_func_dir: "{{home}}/.config/fish/functions"
func_file: char.fish
when: repo is exists
block:
- name: Create ~/.unicode.data
command: fish make.fish
args:
chdir: "{{repo}}"
creates: "{{home}}/.unicode.data"
- name: Install the char function in Fish
command: "cp {{func_file}} {{fish_func_dir}}"
args:
chdir: "{{repo}}"
creates: "{{fish_func_dir}}/{{func_file}}"
- name: Clojure
tags:
- clojure
- languages
vars:
local: "{{ home }}/.local"
bin: "{{ local }}/bin"
block:
- file:
path: "{{ bin }}"
state: directory
- name: clj
block:
- name: Install clj dependencies
become: true
package:
state: present
name:
- rlwrap
- name: Download clj installer
get_url:
url: https://download.clojure.org/install/linux-install-1.10.1.492.sh
dest: /tmp
mode: a+x
register: installer
- name: Run clj installer
command:
cmd: "{{ installer.dest }} --prefix {{ local }}"
- name: Leiningen
get_url:
url: https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein
dest: "{{ bin }}/lein"
mode: a+x
- name: git diff
tags: [git]
vars:
bin: "{{ home }}/.local/bin"
block:
- file:
path: "{{ bin }}"
state: directory
- get_url:
url: https://raw.githubusercontent.com/so-fancy/diff-so-fancy/master/third_party/build_fatpack/diff-so-fancy
dest: "{{ bin }}/diff-so-fancy"
mode: a+rx