-
Notifications
You must be signed in to change notification settings - Fork 0
/
playbook.yml
242 lines (216 loc) · 7.91 KB
/
playbook.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
---
- hosts: all
tasks:
- name: Ansible check ohmyzsh exists
stat:
path: ~/.oh-my-zsh
register: ohmyzsh_details
- name: install oh-my-zsh
ansible.builtin.shell:
cmd: sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
when: not ohmyzsh_details.stat.exists
- file: path=~/bin state=directory mode=0755
- file: path=~/.oh-my-zsh/themes state=directory mode=0755
- file: path=~/.oh-my-zsh/themes/lib state=directory mode=0755
- file: path=~/.config/zsh-theme state=directory mode=0755
- file: path=~/.vsnip state=directory mode=0755
- file: path=~/.gnupg state=directory mode=0700
- name: ensure file exists
copy:
content: ""
dest: ~/.work.zshrc
force: no
mode: 0755
- name: copy gitconfig file
copy:
src: "{{ansible_env.PWD}}/config/gitconfig"
dest: ~/.gitconfig
force: yes
mode: 0755
# Mac OS from here..
- name: update brew
when: ansible_os_family == "Darwin"
homebrew: update_homebrew=yes
- name: add Homebrew taps
when: ansible_os_family == "Darwin"
homebrew_tap: name={{item}}
with_items:
- homebrew/cask-fonts
- git-duet/tap
- name: install Homebrew casks
when: ansible_os_family == "Darwin"
homebrew_cask: name={{item}} install_options=appdir=/Applications
with_items:
- font-inconsolata
- font-inconsolata-nerd-font
- font-meslo-lg-nerd-font
- google-cloud-sdk
- ngrok
- rectangle
- visual-studio-code
- name: install Homebrew packages
when: ansible_os_family == "Darwin"
homebrew:
name: "{{item.name}}"
install_options: "{{item.install_options}}"
state: latest
with_items:
- {name: asdf, install_options: ''}
- {name: awscli, install_options: ''}
- {name: bat, install_options: ''}
- {name: ctags, install_options: ''}
- {name: colima, install_options: ''}
- {name: diff-so-fancy, install_options: ''}
- {name: direnv, install_options: ''}
- {name: docker, install_options: ''}
- {name: docker-compose, install_options: ''}
- {name: fasd, install_options: ''}
- {name: fd, install_options: ''}
- {name: fzf, install_options: ''}
- {name: gcc, install_options: ''}
- {name: gh, install_options: ''}
- {name: git, install_options: ''}
- {name: git-duet, install_options: ''}
- {name: git-extras, install_options: ''}
- {name: gnu-sed, install_options: ''}
- {name: glances, install_options: ''}
- {name: go, install_options: ''}
- {name: htop, install_options: ''}
- {name: jq, install_options: ''}
- {name: kind, install_options: ''}
- {name: libgit2, install_options: ''}
- {name: lima, install_options: ''}
- {name: mr, install_options: ''}
- {name: neovim, install_options: ''}
- {name: node, install_options: ''}
- {name: openssl, install_options: ''}
- {name: pcre, install_options: ''}
- {name: pipx, install_options: ''}
- {name: pinentry-mac, install_options: ''}
- {name: pstree, install_options: ''}
- {name: redis, install_options: ''}
- {name: ripgrep, install_options: ''}
- {name: shellcheck, install_options: ''}
- {name: the_silver_searcher, install_options: ''}
- {name: tig, install_options: ''}
- {name: tmate, install_options: ''}
- {name: tmux, install_options: ''}
- {name: tree, install_options: ''}
- {name: watch, install_options: ''}
- {name: wget, install_options: ''}
- {name: yarn, install_options: ''}
- {name: yq, install_options: ''}
- {name: 1password-cli, install_options: ''}
# Mac OS end here.
# Linux from here..
- name: add diff-so-fancy-package
when: ansible_os_family == "Debian"
become: yes
ansible.builtin.apt_repository:
codename: focal
repo: 'ppa:aos1/diff-so-fancy'
- name: neovim-package
when: ansible_os_family == "Debian"
become: yes
ansible.builtin.apt_repository:
repo: 'ppa:neovim-ppa/unstable'
- name: update apt cache
when: ansible_os_family == "Debian"
become: yes
apt: update-cache=yes
- name: install base dependencies
when: ansible_os_family == "Debian"
become: yes
apt: pkg={{ item }} state=latest
with_items:
- build-essential
- universal-ctags
- curl
- diff-so-fancy
- direnv
- docker.io
- docker-compose
- fasd
- fd-find
- fzf
- git-core
- git-extras
- glances
- htop
- jq
- libexpat1-dev
- libssl-dev
- neovim
- nodejs
- npm
- pipx
- python3-apt
- python3-pip
- python3-pycurl
- python3-setuptools
- python3-software-properties
- ripgrep
- tig
- tree
- watch
- yarn
- name: install bat
when: ansible_os_family == "Debian"
become: yes
apt:
deb: "https://github.com/sharkdp/bat/releases/download/v0.18.3/bat_0.18.3_amd64.deb"
- name: update timezone
when: ansible_os_family == "Debian"
become: true
command: timedatectl set-timezone America/Sao_Paulo
# Linux end here.
- name: configures gpg and pinentry
command: echo "pinentry-program $(brew --prefix)/bin/pinentry-mac" | tee ~/.gnupg/gpg-agent.conf
- name: get Tmux Plugin Manager
git:
repo: https://github.com/tmux-plugins/tpm
dest: ~/.tmux/plugins/tpm
- name: install support for nvim
command: pip3 install --user --upgrade pynvim --break-system-packages
- name: install nvim distribution
git:
repo: https://github.com/albertoleal/nvim
dest: ~/.config/nvim
- file: path=~/.config/nvim/lua/user state=directory mode=0755
- name: install dracula theme
git:
repo: https://github.com/dracula/zsh.git
dest: ~/.config/zsh-theme
- name: symlinks
file:
path: "{{item.target}}"
src: "{{item.src}}"
state: link
force: yes
with_items:
- {target: ~/.zshrc, src: "{{ansible_env.PWD}}/config/zsh/zshrc"}
- {target: ~/.zlogin, src: "{{ansible_env.PWD}}/config/zsh/zlogin"}
- {target: ~/.oh-my-zsh/themes/pairing.zsh-theme, src: "{{ansible_env.PWD}}/config/zsh/pairing.zsh-theme"}
- {target: ~/.oh-my-zsh/themes/dracula.zsh-theme, src: "~/.config/zsh-theme/dracula.zsh-theme"}
- {target: ~/.oh-my-zsh/themes/lib/async.zsh, src: "~/.config/zsh-theme/lib/async.zsh"}
- {target: ~/.rubocop.yml, src: "{{ansible_env.PWD}}/config/ruby/rubocop.yml"}
- {target: ~/.ruby-version, src: "{{ansible_env.PWD}}/config/ruby/ruby-version"}
- {target: ~/.pryrc, src: "{{ansible_env.PWD}}/config/ruby/pryrc"}
- {target: ~/.ansible.cfg, src: "{{ansible_env.PWD}}/config/ansible.cfg"}
- {target: ~/.aliases, src: "{{ansible_env.PWD}}/config/zsh/aliases"}
- {target: ~/.irbrc, src: "{{ansible_env.PWD}}/config/irbrc"}
- {target: ~/.config/nvim/lua/user/before.lua, src: "{{ansible_env.PWD}}/config/nvim/before.lua"}
- {target: ~/.config/nvim/lua/user/plugins.lua, src: "{{ansible_env.PWD}}/config/nvim/plugins.lua"}
- {target: ~/.config/nvim/lua/user/after.lua, src: "{{ansible_env.PWD}}/config/nvim/after.lua"}
- {target: ~/.config/nvim/coc-settings.json, src: "{{ansible_env.PWD}}/config/nvim/coc-settings.json"}
- {target: ~/.vsnip/ruby.json, src: "{{ansible_env.PWD}}/config/nvim/vsnip/ruby.json"}
- {target: ~/.vsnip/go.json, src: "{{ansible_env.PWD}}/config/nvim/vsnip/go.json"}
- {target: ~/.tmux.conf, src: "{{ansible_env.PWD}}/config/tmux.conf"}
- {target: ~/bin/load-key, src: "{{ansible_env.PWD}}/functions/load-key"}
- {target: ~/bin/duet, src: "{{ansible_env.PWD}}/functions/duet"}
- {target: ~/bin/solo, src: "{{ansible_env.PWD}}/functions/solo"}
- {target: ~/bin/take, src: "{{ansible_env.PWD}}/functions/take"}
- {target: ~/bin/ssh-pass, src: "{{ansible_env.PWD}}/functions/ssh-pass"}
- {target: ~/bin/codeplane, src: "{{ansible_env.PWD}}/functions/codeplane"}
- {target: ~/bin/upgrade, src: "{{ansible_env.PWD}}/functions/upgrade"}
- {target: ~/bin/vipe, src: "{{ansible_env.PWD}}/functions/vipe"}