-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.yml
163 lines (139 loc) · 4.52 KB
/
main.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
---
- hosts: localhost
connection: local
vars_files:
- config.yml
tasks:
- name: Set hostname
ansible.builtin.hostname:
name: "{{ hostname }}"
use: systemd
- name: Install overlay packages
community.general.rpm_ostree_pkg:
name: "{{ item }}"
state: present
loop: "{{ ostreeInstallRpms }}"
notify:
- Reboot
- name: Remove ostree packages
ansible.builtin.command: "rpm-ostree override remove {{ ostreeUninstallRpms | join(' ') }}"
register: ostreePackageRemove
failed_when:
- ostreePackageRemove.rc > 0
- '"Override already exists for package" not in ostreePackageRemove.stderr'
until: "ostreePackageRemove is not failed"
retries: 6
delay: 10
notify:
- Reboot
- name: Update Silverblue
ansible.builtin.command: rpm-ostree upgrade
notify:
- Reboot
- name: Create Toolbox
ansible.builtin.command: toolbox create -y
register: toolboxCreate
failed_when:
- toolboxCreate.rc > 0
- '"already exists" not in toolboxCreate.stderr'
- name: Install Toolbox packages
ansible.builtin.command: "toolbox run sudo dnf install -y {{ toolboxInstallRpms | join(' ') }}"
- name: Change default shell to zsh
ansible.builtin.command: "usermod --shell /bin/zsh {{ username }}"
become: yes
- name: Remove the default flathub flatpak repository remote
community.general.flatpak_remote:
name: flathub
state: absent
become: yes
- name: Add the flathub flatpak repository remote
community.general.flatpak_remote:
name: flathub
state: present
flatpakrepo_url: https://dl.flathub.org/repo/flathub.flatpakrepo
become: yes
- name: Install flatpak packages
community.general.flatpak:
name: "{{ item }}"
state: present
loop: "{{ flatpaks }}"
register: flatpakInstall
until: "flatpakInstall is not failed"
retries: 6
delay: 10
- name: Change Firefox flatpak to use native Wayland
ansible.builtin.command: flatpak override --socket=wayland --env=MOZ_ENABLE_WAYLAND=1 org.mozilla.firefox
become: yes
- name: Create directories
ansible.builtin.file:
path: "~/{{ item }}"
state: directory
loop: "{{ homeDirectories }}"
- name: Pull Tela icons
ansible.builtin.git:
repo: 'https://github.com/vinceliuice/Tela-icon-theme.git'
dest: ~/repos/Tela-icon-theme
update: no
- name: Install Tela icons
ansible.builtin.command: ./install.sh
args:
chdir: ~/repos/Tela-icon-theme
- name: Copy themes to home directory
ansible.builtin.command: toolbox run cp -R /usr/share/themes/Arc-Dark ~/.themes/
- name: Include GNOME Extensions role
include_role:
name: jaredhocutt.gnome_extensions
- name: Change dconf settings
community.general.dconf:
key: "{{ item.key }}"
value: "{{ item.value }}"
loop: "{{ dconfSettings }}"
- name: Enable wifi MAC randomisation
ansible.builtin.copy:
dest: /etc/NetworkManager/conf.d/mac-randomization.conf
content: |
[device-mac-randomization]
wifi.scan-rand-mac-address=yes
[connection-mac-randomization]
#ethernet.assigned-mac-address=random
wifi.assigned-mac-address=random
become: yes
notify:
- Restart NetworkManager
- name: Modify wifi connection settings
community.general.nmcli:
type: wifi
conn_name: "{{ wifiSSID }}"
ssid: "{{ wifiSSID }}"
wifi:
cloned-mac-address: preserve
wifi_sec:
auth-alg: ""
key-mgmt: sae
pmf: 3
state: present
notify:
- Restart NetworkManager
- name: Add shortcut to Gnome Tweaks
ansible.builtin.copy:
dest: ~/.local/share/applications/GnomeTweaks.desktop
content: |
[Desktop Entry]
Type=Application
Name=Gnome Tweaks (toolbox)
Exec=/bin/toolbox run gnome-tweaks
Icon=org.gnome.Settings
Terminal=false
handlers:
- name: Restart NetworkManager
ansible.builtin.service:
name: NetworkManager
state: restarted
- name: Pause Reboot
ansible.builtin.pause:
prompt: "System will reboot in 1 minute"
minutes: 1
listen: "Reboot"
- name: Reboot system
ansible.builtin.command: systemctl reboot
listen: "Reboot"