-
Notifications
You must be signed in to change notification settings - Fork 1
/
bootstrap.yml
207 lines (190 loc) · 5.25 KB
/
bootstrap.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
- name: Bootstrap development environment
hosts: localhost
tasks:
- name: Install cask packages with brew
become: no
community.general.homebrew_cask:
name:
- wezterm
- font-fira-code-nerd-font
- font-meslo-lg-nerd-font
- font-symbols-only-nerd-font
when: ansible_distribution == "MacOSX"
- name: Install regular packages with brew
become: no
community.general.homebrew:
name:
# neovim
- nvim
# Programming Languages
- asdf
# git
- git
- lazygit
- forgit
# tmux
- tmux
- reattach-to-user-namespace
- joshmedeski/sesh/sesh
# yazi dependencies
- yazi
- ffmpegthumbnailer # ffmpeg thumbnails for yazi
- poppler # pdf rendering library
# Docker dependencies
- colima
- docker
- kubectl
- kubectx
- k9s
- kubecolor
# Command Line Utilities
- fd
- ripgrep
- fzf
- zoxide
- rclone
- unar
- jq
- watchexec
- just
- direnv
- sheldon
- stow
- fzf
- ripgrep
- the_silver_searcher
- pv
- gum
- hyperfine
- parallel
state: present
upgrade_all: false
when: ansible_distribution == "MacOSX"
- name: Install kubernetes
become: yes
command: curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.31/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg
args:
creates: /etc/apt/keyrings/kubernetes-apt-keyring.gpg
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
- name: Change file ownership, group and permissions
become: yes
ansible.builtin.file:
path: /etc/apt/keyrings/kubernetes-apt-keyring.gpg
mode: '0644'
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
- name: add kubernetes repo
become: yes
ansible.builtin.apt_repository:
repo: deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.31/deb/ /
state: present
filename: kubernetes
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
#- name: add debian repo
# become: yes
# ansible.builtin.apt_repository:
# repo: deb [trusted=yes] http://ftp.de.debian.org/debian buster main
# state: present
# filename: debian
# when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
- name: Install packages with apt
become: yes
ansible.builtin.apt:
# update_cache: true
pkg:
# neovim
- neovim
# git
- git
# tmux
- tmux
## Docker dependencies
- docker
- kubectl
- kubectx
- kubecolor
## Command Line Utilities
- curl
- fd-find
- ripgrep
- fzf
- zoxide
- rclone
# Causes a problem when installing for some reason
#- unar
- jq
- direnv
- stow
- ripgrep
- silversearcher-ag
- pv
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu'
#- name: Install packages with snap
# community.general.snap:
# name:
# - k9s
# --- Install Rust ---
- name: check if cargo is installed
shell: command -v cargo
register: cargo_exists
ignore_errors: yes
- name: Download Installer
when: cargo_exists is failed
get_url:
url: https://sh.rustup.rs
dest: /tmp/sh.rustup.rs
mode: '0755'
force: 'yes'
tags:
- rust
- name: install rust/cargo
when: cargo_exists is failed
shell: /tmp/sh.rustup.rs -y
tags:
- rust
- name: install rust packages
community.general.cargo:
name:
- clap
- watchexec-cli
- sheldon
- exa
- zoxide
tags:
- rust
# TODO: better changed_when
# Install fzf
- name: install fzf
shell:
cmd: "$(brew --prefix)/opt/fzf/install --all"
changed_when: False
when: ansible_distribution == "MacOSX"
# Oh My tmux
- name: Setup tmux
become: no
ansible.builtin.git:
depth: 1
dest: ~/.tmux
repo: https://github.com/gpakosz/.tmux.git
# setup asdf
- name: Setup asdf
become: no
ansible.builtin.git:
depth: 1
dest: ~/.asdf
repo: https://github.com/asdf-vm/asdf.git
version: v0.14.1
- name: Symlink tmux
ansible.builtin.file:
state: "link"
src: ~/.tmux/.tmux.conf
dest: ~/.tmux.conf
- name: Run stow
shell:
cmd: "stow {{ item }} --target {{ ansible_env.HOME }} --verbose=2"
register: result
changed_when: 'result.stderr is search("LINK: ")'
loop:
- neovim
- tmux
- zsh
- wezterm