-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.yml
328 lines (283 loc) · 7.92 KB
/
setup.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
---
- hosts: 127.0.0.1
connection: local
tasks:
- name: ubuntu reqs
become: true
apt:
name: "{{ packages }}"
state: present
vars:
packages:
- software-properties-common
- build-essential
- cmake
- python3-pip
- python3-pip
- python3-virtualenv
- libxss1
- libappindicator1
- libindicator7
- git-core
- curl
- dconf-cli
- xclip
- libreadline-dev
- zlib1g-dev
- postgresql
- postgresql-contrib
- libpq-dev
- patch
- liblzma-dev
- qt5-default
- libqt5webkit5-dev
- awscli
- libncurses5-dev
- libffi-dev
- libgdbm-dev
- autoconf
- libyaml-dev
- imagemagick
- libmagickwand-dev
- redis-server
- mmv
- rename
- tmux
- zsh
- name: zsh default
become: true
command: chsh -s /usr/bin/zsh jerry
tags: zsh
- name: zsh omz
become: true
shell: sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
args:
creates: ~/.oh-my-zsh/oh-my-zsh.sh
- name: zsh config
command: ln -s ~/devmachine/dotfiles/.zshrc ~/.zshrc
args:
creates: ~/.zshrc
tags: zsh
# libssl 1.0 is needed for ruby 2.3 and older
- name: libssl1.0 repo
become: true
apt_repository:
repo: deb http://security.ubuntu.com/ubuntu bionic-security main
state: present
tags: libssl1.0
- name: libssl1.0
become: true
apt:
name: libssl1.0-dev
update_cache: yes
tags: libssl1.0
- name: symlink .tmux.conf
command: ln -s ~/devmachine/dotfiles/.tmux.conf ~/.tmux.conf
args:
creates: ~/.tmux.conf
tags: tmux
- name: symlink alarcitty conf
command: ln -s ~/devmachine/dotfiles/.alacritty.yml ~/.alacritty.yml
args:
creates: ~/.alacritty.yml
tags: alacritty
- name: neovim install
become: true
apt:
name: neovim
update_cache: yes
tags: neovim
- name: neovim alternatives
become: true
shell: >
update-alternatives --install /usr/bin/vi vi /usr/bin/nvim 60;
update-alternatives --config vi;
update-alternatives --install /usr/bin/vim vim /usr/bin/nvim 60;
update-alternatives --config vim;
update-alternatives --install /usr/bin/editor editor /usr/bin/nvim 60;
update-alternatives --config editor
- name: symlink .vimrc
command: ln -s ~/devmachine/dotfiles/.vimrc ~/.vimrc
args:
creates: ~/.vimrc
tags: vim
- name: symlink .vimrc with neovim init
shell: |
mkdir -p ~/.config/nvim
ln -s ~/.vimrc ~/.config/nvim/init.vim
args:
creates: ~/.config/nvim/init.vim
tags: vim
- name: vim-plug
command: curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
args:
creates: ~/.vim/autoload/plug.vim
tags: vim
- name: symlink coc-settings
shell: ln -s ~/devmachine/dotfiles/coc-settings.json ~/.config/nvim/coc-settings.json
args:
creates: ~/.config/nvim/coc-settings.json
tags: vim
- name: coc install
command: vim +CocInstall +qall
- name: clone rbenv
git: >
repo=git://github.com/sstephenson/rbenv.git
dest=~/.rbenv
tags: rbenv
- name: rbenv plugins
git: >
repo=git://github.com/sstephenson/ruby-build.git
dest=~/.rbenv/plugins/ruby-build
tags: rbenv
- name: install ruby 2.3.1
shell: ~/.rbenv/bin/rbenv install -v 2.3.1
args:
creates: ~/.rbenv/versions/2.3.1/bin/ruby
tags: rbenv
- name: set global version of ruby to 2.3.1
shell: ~/.rbenv/bin/rbenv global 2.3.1
tags: rbenv
- name: bashrc
shell: grep -qxF 'source ~/devmachine/dotfiles/.bashrc' ~/.bashrc || echo 'source ~/devmachine/dotfiles/.bashrc' >> ~/.bashrc
tags: bashrc
- name: create .gitconfig if doesn't exist
file:
name: /home/jerry/.gitconfig
state: touch
- name: git aliases
command: git config --global alias.{{ item.abbr }} {{ item.command }}
with_items:
- { abbr: 'co', command: 'checkout' }
- { abbr: 'dc', command: 'diff --cached' }
- { abbr: 'pop', command: "'reset --soft head~1'" }
- { abbr: 'reword', command: "'commit --only --amend'" }
- { abbr: 'st', command: 'status' }
- { abbr: 'pushf', command: 'push --force-with-lease' }
- { abbr: 'unpulled', command: "'!\"git fetch && git log HEAD..@{u}\"'" }
- { abbr: 'unpushed', command: "'log @{u}..HEAD'" }
# Run base16_${theme-name} after to install
- name: gnome shell base 16
git:
repo: https://github.com/chriskempson/base16-shell.git
dest: ~/.config/base16-shell
- name: docker key
become: true
apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
state: present
tags: docker
- name: docker repo
become: true
apt_repository:
repo: deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable
tags: docker
- name: docker install
become: true
apt:
name: docker-ce
update_cache: yes
tags: docker
- name: adding {{ansible_user_id}} to docker group
become: true
command: usermod -aG docker {{ansible_user_id}}
tags: docker
- name: docker compose
become: true
shell: >
curl -L "https://github.com/docker/compose/releases/download/1.25.5/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose;
chmod +x /usr/local/bin/docker-compose
args:
creates: /usr/local/bin/docker-compose
- name: erlang repo
become: true
apt:
deb: https://packages.erlang-solutions.com/erlang-solutions_2.0_all.deb
tags: elixir
- name: erlang
become: true
apt:
name: esl-erlang
update_cache: yes
tags: elixir
- name: kiex download
get_url:
url: https://raw.githubusercontent.com/taylor/kiex/master/kiex
dest: /tmp/kiex
tags: elixir
- name: install kiex
command: bash kiex install_kiex
args:
chdir: /tmp
creates: ~/.kiex
tags: elixir
- name: install n node version manager
shell: curl -L https://git.io/n-install | bash -s -- -y
args:
creates: ~/n
chdir: ~/
tags: n
- name: symlink n
command: ln -s ~/n/bin/n /usr/local/bin/n
args:
creates: /usr/local/bin/n
tags: n
- name: g go version mananger
shell: curl -sSL https://git.io/g-install | bash -s -- -y
args:
creates: ~/go
tags: go
- name: symlink g
become: true
command: ln -s ~/go/bin/g /usr/local/bin/g
args:
creates: /usr/local/bin/g
tags: go
- name: download rust installer
get_url:
url: https://sh.rustup.rs
dest: /tmp/rust.sh
tags: rust
- name: install rust
command: bash /tmp/rust.sh -y
tags: rust
args:
creates: ~/.cargo/bin/rustup
- name: update rust
shell: ~/.cargo/bin/rustup update
tags: rust
- name: ripgrep
command: ~/.cargo/bin/cargo install ripgrep --force
args:
creates: ~/.cargo/bin/rg
- name: kubectl
become: true
snap:
name: kubectl
classic: yes
tags: k8s
- name: helm
become: true
snap:
name: helm
classic: yes
tags: k8s
- name: krew
shell: |
(
set -x; cd "$(mktemp -d)" &&
OS="$(uname | tr '[:upper:]' '[:lower:]')" &&
ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')" &&
KREW="krew-${OS}_${ARCH}" &&
curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/${KREW}.tar.gz" &&
tar zxvf "${KREW}.tar.gz" &&
./"${KREW}" install krew
)
tags: k8s
args:
creates: ~/.krew/bin/kubectl-krew
- name: kubectx
command: kubectl krew install ctx
tags: k8s
args:
creates: ~/.krew/bin/kubectl-ctx