-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathworkstation.yaml
254 lines (228 loc) · 6.13 KB
/
workstation.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
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
# ====================================================
# Basic server setup
# ====================================================
---
- hosts: localhost
become: false
gather_facts: true
user: "{{lookup('env', 'USER')}}"
vars:
home: "{{ansible_user_dir}}"
codename: "{{ansible_distribution_release}}"
vars_prompt:
- name: arch
prompt: "Select hardware architecture (arm64/amd64):"
default: "amd64"
private: false
tasks:
- name: Confirm variable facts are populated and accurate
ansible.builtin.debug:
msg:
- "$HOME is set to {{ home }}"
- "User is {{ansible_user}}"
- "Codename is {{codename}}"
- "Architecture is {{arch}}"
- name: varcheck
pause:
prompt: "Check variables above. Hit return to continue. Have you done ssh keys?"
- name: Create .config dir
file:
path: "{{home}}/.config"
state: directory
- name: Create zsh config dir
file:
path: "{{home}}/.config/zsh"
state: directory
- name: Create nvim config dir
file:
path: "{{home}}/.config/nvim"
state: directory
- name: install essential packages
apt:
name:
- git
- software-properties-common
- python3-pip
- apt-transport-https
- ca-certificates
- curl
- gnupg-agent
update_cache: true
become: true
- name: install all packages
apt:
name:
- zoxide
- appstream
- attr
- autoconf
- automake
- autopoint
- autotools-dev
- bind9-host
- cgroupfs-mount
- cmdtest
- discover
- discover-data
- dns-root-data
- dnsutils
- doc-debian
- emacsen-common
- exfat-fuse
- kitty
- fd-find
- ffmpeg
- fontconfig
- fonts-dejavu-core
- gdisk
- hdparm
- iw
- keyboard-configuration
- laptop-detect
- locales
- lsof
- lz4
- m4
- mailutils
- mailutils-common
- make
- man-db
- mariadb-common
- mdadm
- modemmanager
- mokutil
- mysql-common
- neovim
- netcat-traditional
- nmap
- nmap-common
- os-prober
- pciutils
- picocom
- pkg-config
- plocate
- powermgmt-base
- ppp
- protobuf-compiler
- psmisc
- python3
- reportbug
- ripgrep
- rsync
- runit-helper
- screen
- smartmontools
- tdb-tools
- tini
- tmux
- traceroute
- udisks2
- unzip
- wireless-regdb
- x11-common
- xclip
- xkb-data
- zsh
- zsh-common
- g++
- libncurses-dev
- fzf
- exa
- libssl-dev
- yamllint
- lm-sensors
- bat
duf
state: latest
update_cache: true
become: true
- name: Installing oh-my-zsh
shell: sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" --unattended
- name: Install powerlevel10k theme
git:
repo: https://github.com/romkatv/powerlevel10k.git
dest: "{{home}}/.oh-my-zsh/custom/themes/powerlevel10k"
depth: 1
- name: Clone mosh repo
git:
repo: https://github.com/mobile-shell/mosh.git
dest: "{{home}}/mosh"
- name: autogen mosh configure file
command: ./autogen.sh
args:
chdir: "{{home}}/mosh"
- name: configure mosh build
command: ./configure
args:
chdir: "{{home}}/mosh"
- name: Build mosh
command: make
args:
chdir: "{{home}}/mosh"
- name: Install mosh
command: make install
args:
chdir: "{{home}}/mosh"
become: true
- name: Add github identity
copy:
dest: "{{home}}/.gitconfig"
content: |
[user]
name = mcondren
email = [email protected]
- name: Export zsh DOTFILE location system-wide
lineinfile: dest=/etc/zsh/zshenv
regexp="^export"
line="export ZDOTDIR=$HOME/.config/zsh"
state=present
become: true
- name: Copy .zshenv to $HOME
copy:
src: "/etc/zsh/zshenv"
dest: "{{home}}/.zshenv"
group: "{{ansible_user_id}}"
owner: "{{ansible_user_id}}"
become: true
- name: Adding github key
shell: |
eval `ssh-agent -s`
ssh-add $HOME/.ssh/github
ssh-add $HOME/.ssh/id_rsa
- name: Clone dotfiles repo
git:
repo: [email protected]:mcondren/dotfiles.git
version: master
dest: "{{home}}/dotfiles"
key_file: "{{home}}/.ssh/github"
accept_hostkey: true
# ssh-agent doesn't allow key to pass through remote sudo commands.
become: false
- name: Create a symbolic links for dotfiles (.zshrc)
ansible.builtin.file:
src: "{{home}}/dotfiles/.zshrc"
dest: "{{home}}/.config/zsh/.zshrc"
state: link
- name: Create a symbolic links for dotfiles (nvim.init)
ansible.builtin.file:
src: "{{home}}/dotfiles/init.vim"
dest: "{{home}}/.config/nvim/init.vim"
state: link
- name: Create a symbolic links for dotfiles (.p10k.zsh)
ansible.builtin.file:
src: "{{home}}/dotfiles/.p10k.zsh"
dest: "{{home}}/.config/zsh/.p10k.zsh"
state: link
- name: Create a symbolic link for dotfiles (kitty)
ansible.builtin.file:
src: "{{home}}/dotfiles/kitty"
dest: "{{home}}/.config/kitty"
state: link
- name: Upgrade all packages
apt: upgrade=safe
become: true
- name: Set shell to ZSH
user:
name: "{{ansible_user_id}}"
shell: /bin/zsh
become: true