-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathansible-random.yml
More file actions
219 lines (205 loc) · 7.13 KB
/
Copy pathansible-random.yml
File metadata and controls
219 lines (205 loc) · 7.13 KB
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
# random stuff setup playbook
# - things which do not fit elsewhere
#
# ansible-random.yml
---
- name: random setup
hosts: all
tasks:
- name: check mandatory variables are defined
assert:
that:
- user is defined
- name: setup modified cz keyboard layout
copy:
src: "/home/{{ user }}/data/config/cz"
dest: "/usr/share/X11/xkb/symbols/cz"
mode: "0644"
- name: check current system keyboard layout
command: localectl status
register: localectl_status
changed_when: false
- name: set cz keyboard layout as system default
command: localectl set-x11-keymap cz pc105
when: "'X11 Layout: cz' not in localectl_status.stdout"
- name: display system restart requirement info
debug:
msg: "System restart required for keyboard layout change to take effect!"
- name: symlink .bashrc file
file:
src: "/home/{{ user }}/data/config/dot-bashrc"
dest: "/home/{{ user }}/.bashrc"
state: link
force: true
become_user: "{{ user }}"
- name: create ~/.config
file:
path: "/home/{{ user }}/.config"
state: directory
become_user: "{{ user }}"
- name: install flake8
dnf:
name: python3-flake8
state: present
- name: get new flake8 config stats
stat:
path: "/home/{{ user }}/data/config/flake8"
register: new_flake8
- name: setup flake8 config
file:
src: "/home/{{ user }}/data/config/flake8"
dest: "/home/{{ user }}/.config/flake8"
state: link
force: true
become_user: "{{ user }}"
when: new_flake8.stat.exists == true
# setup start script
- name: create ~/.config/autostart
file:
path: "/home/{{ user }}/.config/autostart"
state: directory
become_user: "{{ user }}"
- name: get new start script stats
stat:
path: "/home/{{ user }}/data/startup/start.desktop"
register: new_start
- name: setup start script
file:
src: "/home/{{ user }}/data/startup/start.desktop"
dest: "/home/{{ user }}/.config/autostart/start.desktop"
state: link
force: true
become_user: "{{ user }}"
when: new_start.stat.exists == true
- name: install gnome-terminal
dnf:
name: gnome-terminal
state: present
# install bat
# otherwise cat does not work due to alias
- name: install bat
dnf:
name: bat
state: present
# installing vlc
# requires rmpfusion
- name: get Fedora version
shell: cut -d\ -f3 /etc/fedora-release
register: fedora_version
changed_when: false
- name: install rpmfusion-free
dnf:
name: "https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-{{ fedora_version.stdout }}.noarch.rpm"
state: present
disable_gpg_check: true
- name: install rpmfusion-nonfree
dnf:
name: "https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-{{ fedora_version.stdout }}.noarch.rpm"
state: present
disable_gpg_check: true
- name: install vlc
dnf:
name: vlc
state: present
# GNOME setup
- name: install GNOME stuff
dnf:
name:
- gnome-tweak-tool
- dconf-editor
- python3-psutil # needed for dconf in the next step
state: present
- name: setup GNOME config
dconf:
key: "{{ item.key }}"
value: "{{ item.val }}"
state: present
become_user: "{{ user }}"
loop:
# remap keys
- key: "/org/gnome/desktop/wm/keybindings/close"
val: "['<Alt>q', '<Alt>F4']"
- key: "/org/gnome/desktop/wm/keybindings/move-to-workspace-down"
val: "['<Super><Shift>Page_Down', '<Control><Shift><Alt>Down', '<Control><Shift><Alt>k']"
- key: "/org/gnome/desktop/wm/keybindings/move-to-workspace-left"
val: "['<Control><Shift><Alt>Left', '<Control><Shift><Alt>j']"
- key: "/org/gnome/desktop/wm/keybindings/move-to-workspace-right"
val: "['<Control><Shift><Alt>Right', '<Control><Shift><Alt>uring']"
- key: "/org/gnome/desktop/wm/keybindings/move-to-workspace-up"
val: "['<Super><Shift>Page_Up', '<Control><Shift><Alt>Up', '<Control><Shift><Alt>l']"
- key: "/org/gnome/desktop/wm/keybindings/switch-to-workspace-down"
val: "['<Super>Page_Down', '<Control><Alt>Down', '<Control><Alt>k']"
- key: "/org/gnome/desktop/wm/keybindings/switch-to-workspace-left"
val: "['<Control><Alt>Left', '<Control><Alt>j']"
- key: "/org/gnome/desktop/wm/keybindings/switch-to-workspace-right"
val: "['<Control><Alt>Right', '<Control><Alt>uring']"
- key: "/org/gnome/desktop/wm/keybindings/switch-to-workspace-up"
val: "['<Super>Page_Up', '<Control><Alt>Up', '<Control><Alt>l']"
- key: "/org/gnome/settings-daemon/plugins/media-keys/logout"
val: "['']" # unbind logout as it may be on ctrl+alt+delete
- key: "/org/gnome/settings-daemon/plugins/media-keys/shutdown"
val: "['<Control><Alt>Delete']"
# set max 4 workspaces
- key: "/org/gnome/desktop/wm/preferences/num-workspaces"
val: "4"
- key: "/org/gnome/mutter/dynamic-workspaces"
val: "false"
# and alt+tab workspace isolated
- key: "/org/gnome/shell/app-switcher/current-workspace-only"
val: "true"
# turn off alert sound
- key: "/org/gnome/desktop/sound/event-sounds"
val: "false"
# allow 100%+ volume
- key: "/org/gnome/desktop/sound/allow-volume-above-100-percent"
val: "true"
# alt-tab on the current workspace only
- key: "/org/gnome/shell/app-switcher/current-workspace-only"
val: "true"
# no colored terminal status reporting
- key: "/org/gnome/Ptyxis/visual-process-leader"
val: "false"
# enable middle-click paste (primary selection)
- key: "/org/gnome/desktop/interface/gtk-enable-primary-paste"
val: "true"
# install and setup development tools
- name: install development tools
dnf:
name:
- gcc
- httpie
- jq
- make
- meld
- tldr
- vagrant
state: present
- name: check boot menu timeout
ansible.builtin.lineinfile:
line: "GRUB_TIMEOUT=0"
path: "/etc/default/grub"
state: present
check_mode: yes
register: out
- name: disable boot menu
block:
- name: replace boot menu timeout
ansible.builtin.replace:
path: "/etc/default/grub"
regexp: "GRUB_TIMEOUT=[0-9]+"
replace: "GRUB_TIMEOUT=0"
- name: update grub2 config
ansible.builtin.shell: grub2-mkconfig -o /boot/grub2/grub.cfg
when:
- out.changed
- scope == "work"
- name: install random graphical stuff
dnf:
name:
- feh
- kolourpaint
state: present
- name: install mediawriter
dnf:
name: mediawriter
state: present