-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlocalhost.yml
More file actions
85 lines (79 loc) · 2.7 KB
/
Copy pathlocalhost.yml
File metadata and controls
85 lines (79 loc) · 2.7 KB
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
#
# Install XCode
# % sudo xcodebuild -license
# % xcode-select --install
# % ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# % brew install ansible git
#
- hosts: localhost
connection: local
gather_facts: no
sudo: no
vars:
homebrew_taps:
- homebrew/binary
- homebrew/dupes
- caskroom/cask
homebrew_packages:
- { name: readline }
- { name: openssl }
- { name: openssl, state: linked, install_options: force }
- { name: python }
- { name: rbenv }
- { name: ruby-build }
- { name: ansible }
- { name: go }
- { name: w3m }
- { name: lv }
- { name: fish }
- { name: peco }
- { name: tmux }
- { name: mysql }
- { name: git }
- { name: mercurial }
homebrew_cask_packages:
- { name: skype }
- { name: slack }
- { name: atom }
- { name: github-desktop }
- { name: caffeine }
- { name: kobito }
- { name: google-chrome }
- { name: bettertouchtool }
- { name: amethyst }
- { name: cheatsheet }
tasks:
- name: homebrew の tap リポジトリを追加
homebrew_tap: tap={{ item }} state=present
with_items: homebrew_taps
- name: homebrew をアップデート
homebrew: update_homebrew=yes
# brew
- name: brew パッケージをインストール
homebrew: >
name={{ item.name }}
state={{ item.state | default('latest') }}
install_options={{
item.install_options | default() | join(',')
if item.install_options is not string
else item.install_options
}}
with_items: homebrew_packages
register: brew_result
- name: brew パッケージの情報保存先ディレクトリを作成
file: path=brew_info state=directory
- name: brew パッケージの情報を保存
shell: brew info {{ item }} > brew_info/{{ item }}
with_items: brew_result.results | selectattr('changed') | map(attribute='item') | map(attribute='name') | list
# cask
- name: homebrew-cask のインストール
homebrew: name=brew-cask state=latest
- name: cask パッケージをインストール
homebrew_cask: name={{ item.name }} state={{ item.state|default('installed') }}
with_items: homebrew_cask_packages
register: cask_result
- name: cask パッケージの情報保存先ディレクトリを作成
file: path=cask_info state=directory
- name: cask パッケージの情報を保存
shell: brew cask info {{ item }} > cask_info/{{ item }}
with_items: cask_result.results | selectattr('changed') | map(attribute='item') | map(attribute='name') | list