-
Notifications
You must be signed in to change notification settings - Fork 0
/
env.yml
253 lines (234 loc) · 6.11 KB
/
env.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
---
- hosts: localhost
vars:
project_dir: "{{ ansible_user_dir }}/code/dotfiles"
handlers:
- name: vundle plugin install
command: "vim +PluginInstall +qall"
tasks:
- name: apply vars to templates
template:
src: "{{ project_dir }}/{{ item }}.j2"
dest: "{{ project_dir }}/{{ item }}"
mode: 0644
with_items:
- bob-profile
- gitconfig
- name: symlink dotfiles
file:
state: link
src: "{{ project_dir }}/{{ item }}"
dest: "{{ ansible_user_dir }}/.{{ item }}"
with_items:
- bob-profile
- gitconfig
- vimrc
- gitignore_global
- name: Check for .config dir
stat:
path: "{{ ansible_user_dir }}/.config"
register: config_dir
- name: Make .config dir
file:
path: "{{ ansible_user_dir }}/.config"
state: directory
mode: 0755
when: not config_dir.stat.exists
- name: symlink starship config
file:
state: link
src: "{{ project_dir }}/{{ item }}"
dest: "{{ ansible_user_dir }}/.config/{{ item }}"
with_items:
- starship.toml
- name: check profile source
shell: cat {{ ansible_user_dir }}/.bash_profile | grep ".bob-profile"
register: profile_exists
changed_when: profile_exists.rc != 0
ignore_errors: true
- name: source profile
shell: echo "source {{ ansible_user_dir }}/.bob-profile" >> {{ ansible_user_dir }}/.bash_profile
when: profile_exists.rc != 0
- name: Core Brew Packages
homebrew:
update_homebrew: yes
name:
- git
- gh
- htop
- the_silver_searcher
- nvm
- wget
- vim
- fzf
- fd
- exa
- jq
- hey
- speedtest-cli
- starship
- openssl
- gnupg
- go
#- terraform
#- packer
state: latest
- name: Homebrew Mac only Packages
homebrew:
name:
- mas
state: latest
when: ansible_os_family == 'Darwin'
- name: Core Brew Casks
homebrew_cask:
name:
- 1password
- alfred
- dozer
- docker
- dropbox
- iterm2
- itsycal
- postman
- spotify
- steam
- dash
- plexamp
- plex
- keybase
- visual-studio-code
# - slack
# - google-chrome
# - amazon-photos
state: latest
when: ansible_os_family == 'Darwin'
- name: List installed Mac Store apps
command: mas list
register: mas_list
check_mode: false
changed_when: false
when: ansible_os_family == 'Darwin'
- name: Install Mac Store Apps
command: mas install "{{ item.id }}"
with_items:
- { id: "1091189122", name: "bear" }
- { id: "937984704", name: "amphetamine" }
- { id: "413857545", name: "divvy" }
- { id: "1274495053", name: "ms to do" }
when: ansible_os_family == 'Darwin' and item.id not in mas_list.stdout
- name: check for vundle
stat: "path={{ ansible_user_dir }}/.vim/bundle/Vundle.vim"
register: install_vundle
- name: vundle install
git:
repo: https://github.com/VundleVim/Vundle.vim.git
dest: "{{ ansible_user_dir }}/.vim/bundle/Vundle.vim"
version: master
register: source_vundle
when: not install_vundle.stat.exists
notify:
- vundle plugin install
- name: update initial key repeat value
osx_defaults:
key: InitialKeyRepeat
type: int
value: 15
state: present
when: ansible_os_family == 'Darwin'
- name: update key repeat value
osx_defaults:
key: KeyRepeat
type: int
value: 1
state: present
when: ansible_os_family == 'Darwin'
- name: update scroll direction
osx_defaults:
domain: .GlobalPreferences
key: com.apple.swipescrolldirection
type: bool
value: false
state: present
when: ansible_os_family == 'Darwin'
- name: Enable Three Finger Drag
osx_defaults:
domain: com.apple.AppleMultitouchTrackpad
key: TrackpadThreeFingerDrag
type: int
value: 1
state: present
when: ansible_os_family == 'Darwin'
- name: update dock location
osx_defaults:
domain: com.apple.dock
key: orientation
type: string
value: right
state: present
when: ansible_os_family == 'Darwin'
- name: update dock to auto-hide
osx_defaults:
domain: com.apple.dock
key: autohide
type: bool
value: true
state: present
when: ansible_os_family == 'Darwin'
- name: only pin active apps
osx_defaults:
domain: com.apple.dock
key: static-only
type: bool
value: true
state: present
when: ansible_os_family == 'Darwin'
- name: set hot corner, bottom left to screensaver
osx_defaults:
domain: com.apple.dock
key: wvous-bl-corner
type: int
value: 5
state: present
when: ansible_os_family == 'Darwin'
- name: Check for screenshots dir
stat:
path: "{{ ansible_user_dir }}/screenshots"
register: screenshots_dir
- name: Make screenshots dir
file:
path: "{{ ansible_user_dir }}/screenshots"
state: directory
mode: 0755
when: ansible_os_family == 'Darwin' and not screenshots_dir.stat.exists
- name: set location for screenshots
osx_defaults:
domain: com.apple.screencapture
key: location
type: string
value: ~/screenshots
state: present
when: ansible_os_family == 'Darwin'
- name: set name for screenshots
osx_defaults:
domain: com.apple.screencapture
key: name
type: string
value: screenshot
state: present
when: ansible_os_family == 'Darwin'
- name: set iterm prefs folder
osx_defaults:
domain: com.googlecode.iterm2.plist
key: PrefsCustomFolder
type: string
value: "{{ project_dir }}"
state: present
when: ansible_os_family == 'Darwin'
- name: tell iterm to use prefs from folder
osx_defaults:
domain: com.googlecode.iterm2.plist
key: LoadPrefsFromCustomFolder
type: bool
value: true
state: present
when: ansible_os_family == 'Darwin'