-
Notifications
You must be signed in to change notification settings - Fork 0
/
playbook.yml
141 lines (131 loc) · 4.23 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
- hosts: all
connection: local
gather_facts: no
become: no
vars:
ansible_python_interpreter: /usr/bin/python3
# for ansible-role-mas
mas_installed_apps:
- { id: 497799835, name: "Xcode (11.6)" }
# for ansible-role-dotfiles
dotfiles_repo: "[email protected]:eichisanden/dotfiles.git"
dotfiles_repo_local_destination: "~/src/github.com/eichisanden/dotfiles"
dotfiles_files:
- .bashrc
- .eslintrc
- .gitattributes
- .gitconfig
- .gitignore
- .psqlrc
- .vimrc
- .zshrc
tasks:
- name: add tap repository to homebrew
homebrew_tap: name={{ item }}
with_items:
- mas-cli/tap
- dbcli/tap
- name: update homebrew
homebrew: update_homebrew=yes
- name: install homebrew cask packages
community.general.homebrew_cask:
name: "{{ item }}"
with_items:
- alfred
- cheatsheet
- clipy
- corretto
- discord
- docker
- dropbox
- evernote
- firefox
- google-chrome
#- intellij-idea
- iterm2
#- jetbrains-toolbox
- karabiner-elements
- kindle
- opera
- postman
- send-to-kindle
- vagrant
- virtualbox
- visual-studio-code
- name: install homebrew packages
homebrew:
name:
- ansible
- anyenv
- git
- go
- gradle
- graphviz
- heroku/brew/heroku
- hugo
- jq
- mas
- nkf
- peco
- pgcli
- python
- tree
- wget
- name: 'check oh-my-zsh'
stat: path=~/.oh-my-zsh/
register: d
- name: 'install oh-my-zsh'
shell: sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
when: d.stat.exists == false
- name: 'change default shell'
user:
name: "{{ ansible_user }}"
shell: /bin/zsh
- name: 'setting macOS'
osx_defaults: >
domain={{ item.domain }}
key={{ item.key }}
type={{ item.type }}
value={{ item.value }}
state={{ item.state|default('present') }}
with_items:
# auto hide dock (need "killall Dock")
- { domain: com.apple.dock, key: autohide, type: bool, value: true }
- { domain: com.apple.dock, key: autohide-time-modifier, type: int, value: 0 }
# Move dock to left side
- { domain: com.apple.dock, key: orientation, type: string, value: "left" }
# Show Status bar in Finder (need "killall Finder")
- { domain: com.apple.finder, key: ShowStatusBar, type: bool, value: true }
# Show Path bar in Finder
- { domain: com.apple.finder, key: ShowPathbar, type: bool, value: true }
# Show Tab bar in Finder
- { domain: com.apple.finder, key: ShowTabView, type: bool, value: true }
# Show the hidden files
- { domain: com.apple.finder, key: AppleShowAllFiles, type: bool, value: true }
# Enable text selection in QuickLook
- { domain: com.apple.finder, key: QLEnableTextSelection, type: bool, value: true }
# Show the battery percentage from the menu bar (need "killall SystemUIServer")
- { domain: com.apple.menuextra.battery, key: ShowPercent, type: string, value: "YES" }
# Set function keys as default (Need reboot)
- { domain: NSGlobalDomain, key: com.apple.keyboard.fnState, type: int, value: 1 }
- name: 'check dein'
stat: path=~/.cache/dein
register: d
- name: 'install dein'
shell: sh <(curl -fsSL https://raw.githubusercontent.com/Shougo/dein.vim/master/bin/installer.sh) ~/.cache/dein
args:
executable: /bin/bash # for process substitution
register: e
when: d.stat.exists == false
- name: list installed vagrant plugin
shell: "vagrant plugin list | awk '{ print $1 }'"
changed_when: false
register: vagrant_plugin_list
- name: install vagrant plugin
shell: "vagrant plugin install {{item}}"
with_items:
- vagrant-vbguest
when: item not in vagrant_plugin_list.stdout_lines
roles:
- geerlingguy.mas
- geerlingguy.dotfiles