-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathansible-playbook-development.yml
251 lines (251 loc) · 7.74 KB
/
ansible-playbook-development.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
# This playbook installs apps and packages needed for general development
- hosts: localhost
pre_tasks:
- name: Make .config directory
file:
path: ~/.config
state: directory
- name: Make projects directory
file:
path: ~/projects
state: directory
- name: Make .bin directory
file:
path: ~/.bin
state: directory
- name: Stow dotfiles for ack
command: stow ack
changed_when: false
- name: Stow dotfiles for Git
command: stow git
changed_when: false
- name: Stow dotfiles for Neovim
command: stow neovim
changed_when: false
- name: Stow dotfiles for ripgrep
command: stow ripgrep
changed_when: false
- name: Stow dotfiles for the Starship prompt
command: stow starship
changed_when: false
- name: Stow dotfiles for tmux
command: stow tmux
changed_when: false
tasks:
- name: Install Mosh
shell: sudo apt-get update && sudo apt-get install -y mosh
register: result
changed_when: result.stdout is not search("0 newly installed")
- name: Update Homebrew and upgrade all existing packages
homebrew:
update_homebrew: yes
upgrade_all: yes
- name: Install ack
homebrew:
name: ack
state: present
- name: Install bat
homebrew:
name: bat
state: present
- name: Install coreutils
homebrew:
name: coreutils
state: present
- name: Install fd
homebrew:
name: fd
state: present
- name: Install fdupes
homebrew:
name: fdupes
state: present
- name: Install fzf
homebrew:
name: fzf
state: present
- name: Install git
homebrew:
name: git
state: present
- name: Install gh
homebrew:
name: github/gh/gh
state: present
- name: Install glow
homebrew:
name: glow
state: present
- name: Install grep
homebrew:
name: grep
state: present
- name: Install gron
homebrew:
name: gron
state: present
- name: Install imagemagick
homebrew:
name: imagemagick
state: present
- name: Install jq
homebrew:
name: jq
state: present
- name: Install less
homebrew:
name: less
state: present
- name: Install neovim
homebrew:
name: neovim
state: present
- name: Install Node.js
homebrew:
name: node
state: present
- name: Install python
homebrew:
name: python
state: present
- name: Install python3
homebrew:
name: python3
state: present
- name: Install ripgrep
homebrew:
name: ripgrep
state: present
- name: Install Ruby
homebrew:
name: ruby
state: present
- name: Install shellcheck
homebrew:
name: shellcheck
state: present
- name: Install the Starship prompt
homebrew:
name: starship
state: present
- name: Install tidy-html5
homebrew:
name: tidy-html5
state: present
- name: Install tldr
homebrew:
name: tealdeer
state: present
- name: Install tmux
homebrew:
name: tmux
state: present
- name: Install tokei
homebrew:
name: tokei
state: present
- name: Install tree
homebrew:
name: tree
state: present
- name: Install uncrustify
homebrew:
name: uncrustify
state: present
- name: Install unzip
homebrew:
name: unzip
state: present
- name: Install watch
homebrew:
name: watch
state: present
- name: Install yq
homebrew:
name: yq
state: present
- name: Install zsh
shell: sudo apt-get update && sudo apt-get install -y zsh
register: result
changed_when: result.stdout is not search("0 newly installed")
- name: Install fzf zsh support
shell: $(brew --prefix)/opt/fzf/install --all
changed_when: false
- name: Install the fzf tab completion script
shell: cd "$HOME" && git clone https://github.com/lincheney/fzf-tab-completion && rm -rf "$HOME/.fzf-tab-completion" || true && mv fzf-tab-completion "$HOME/.fzf-tab-completion"
changed_when: false
- name: Install tmux-yank dependencies
shell: sudo apt-get update && sudo apt-get install -y xsel
register: result
changed_when: result.stdout is not search("0 newly installed")
- name: Install gvm dependencies
shell: sudo apt-get update && sudo apt-get install -y curl git mercurial make binutils bison gcc build-essential
register: result
changed_when: result.stdout is not search("0 newly installed")
- name: Install gvm
shell: GVM_NO_UPDATE_PROFILE=true zsh < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)
args:
executable: /usr/bin/zsh
register: result
changed_when: result.stdout is not search("Already installed! Remove old installation by running")
failed_when: result.rc != 0 and result.stdout is not search("Already installed! Remove old installation by running")
- name: Install go1.18.5 via gvm
shell: source ~/.gvm/scripts/gvm && gvm install go1.18.5 --prefer-binary && gvm use go1.18.5 --default
args:
executable: /usr/bin/zsh
changed_when: false
- name: Update all global NPM packages
shell: npm update -g
changed_when: false
- name: Install "prettier" Node.js package globally
npm:
name: prettier
global: yes
- name: Install "markdown-cli" Node.js package globally
npm:
name: markdown-cli
global: yes
- name: Install "bash-language-server" Node.js package globally
npm:
name: bash-language-server
global: yes
- name: Install "yaml-language-server" Node.js package globally
npm:
name: yaml-language-server
global: yes
- name: Install neovim Python modules
shell: pip3 install msgpack neovim -U
register: result
changed_when: "result.stdout is not search('Requirement already up-to-date: neovim') and result.stdout is not search('Requirement already up-to-date: msgpack')"
- name: Install vim-plug
command: curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
changed_when: false
- name: Install nvim plugins
command: nvim --headless +GoUpdateBinaries +PlugClean! +PlugUpdate +PlugUpgrade +UpdateRemotePlugins +qall
changed_when: false
- name: Install Oh My Zsh
shell: sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
register: result
changed_when: result.stdout is not search("ZSH folder already exists")
failed_when: result.rc != 0 and result.stdout is not search("ZSH folder already exists")
- name: Remove the default ~/.zshrc
file:
path: ~/.zshrc
state: absent
changed_when: false
- name: Stow dotfiles for Oh My Zsh
command: stow zsh
changed_when: false
- name: Change user shell to Zsh
shell: command -v zsh | sudo tee -a /etc/shells && sudo usermod --shell $(command -v zsh) $(whoami)
changed_when: false
failed_when: false
- name: Install imcat
shell: cd "$HOME" && git clone https://github.com/stolk/imcat.git && cd imcat && make && mv imcat ~/.bin && cd .. && rm -rf imcat
changed_when: false
- name: Update tldr
shell: tldr --update
changed_when: false
- name: Run brew cleanup
shell: brew cleanup
changed_when: false