├── LICENSE ├── README.md ├── hosts └── localhost.yml /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Takuto Wada 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # macbook-provisioning 2 | 3 | [Mac の開発環境構築を自動化する (2015 年初旬編) - t-wadaのブログ](http://t-wada.hatenablog.jp/entry/mac-provisioning-by-ansible) で書いた playbook です 4 | -------------------------------------------------------------------------------- /hosts: -------------------------------------------------------------------------------- 1 | localhost 2 | -------------------------------------------------------------------------------- /localhost.yml: -------------------------------------------------------------------------------- 1 | - hosts: localhost 2 | connection: local 3 | gather_facts: no 4 | sudo: no 5 | vars: 6 | homebrew_taps: 7 | - homebrew/binary 8 | - homebrew/dupes 9 | - caskroom/cask 10 | - railwaycat/emacsmacport 11 | - sanemat/font 12 | homebrew_packages: 13 | - { name: readline } 14 | - { name: openssl } 15 | - { name: openssl, state: linked, install_options: force } 16 | - { name: python } 17 | - { name: ansible } 18 | - { name: coreutils } 19 | - { name: git } 20 | - { name: zsh, install_options: disable-etcdir } 21 | - { name: wget } 22 | - { name: curl } 23 | - { name: cmake } 24 | - { name: autoconf } 25 | - { name: automake } 26 | - { name: pkg-config } 27 | - { name: ctags } 28 | - { name: tree } 29 | - { name: lv } 30 | - { name: nkf } 31 | - { name: jq } 32 | - { name: go } 33 | - { name: direnv } 34 | - { name: peco } 35 | - { name: hub } 36 | - { name: tig } 37 | - { name: fish } 38 | - { name: rbenv } 39 | - { name: ruby-build } 40 | - { name: tofrodos } 41 | - { name: lha } 42 | - { name: flow } 43 | - { name: mysql } 44 | - { name: sqlite } 45 | - { name: redis } 46 | - { name: imagemagick } 47 | - { name: mercurial } 48 | - { name: packer } 49 | - { name: xz } 50 | - { name: socat } 51 | - { name: rlwrap } 52 | - { name: w3m } 53 | - { name: tmux } 54 | - { name: reattach-to-user-namespace } 55 | - { name: phantomjs } 56 | - { name: graphviz } 57 | - { name: autojump } 58 | - { name: gibo } 59 | - { name: source-highlight } 60 | homebrew_cask_packages: 61 | - { name: emacs-mac } 62 | - { name: iterm2 } 63 | - { name: firefox } 64 | - { name: google-chrome } 65 | - { name: adobe-reader } 66 | - { name: java } 67 | - { name: skype } 68 | - { name: slack } 69 | - { name: sourcetree } 70 | - { name: gitx } 71 | - { name: karabiner } 72 | - { name: seil } 73 | - { name: flux } 74 | - { name: dash } 75 | - { name: skitch } 76 | - { name: seashore } 77 | - { name: atom } 78 | - { name: kobito } 79 | - { name: webstorm } 80 | - { name: phpstorm } 81 | - { name: intellij-idea } 82 | - { name: vagrant } 83 | - { name: virtualbox } 84 | 85 | tasks: 86 | - name: homebrew の tap リポジトリを追加 87 | homebrew_tap: tap={{ item }} state=present 88 | with_items: homebrew_taps 89 | 90 | - name: homebrew をアップデート 91 | homebrew: update_homebrew=yes 92 | 93 | # brew 94 | - name: brew パッケージをインストール 95 | homebrew: > 96 | name={{ item.name }} 97 | state={{ item.state | default('latest') }} 98 | install_options={{ 99 | item.install_options | default() | join(',') 100 | if item.install_options is not string 101 | else item.install_options 102 | }} 103 | with_items: homebrew_packages 104 | register: brew_result 105 | - name: brew パッケージの情報保存先ディレクトリを作成 106 | file: path=brew_info state=directory 107 | - name: brew パッケージの情報を保存 108 | shell: brew info {{ item }} > brew_info/{{ item }} 109 | with_items: brew_result.results | selectattr('changed') | map(attribute='item') | map(attribute='name') | list 110 | 111 | # cask 112 | - name: homebrew-cask のインストール 113 | homebrew: name=brew-cask state=latest 114 | - name: cask パッケージをインストール 115 | homebrew_cask: name={{ item.name }} state={{ item.state|default('installed') }} 116 | with_items: homebrew_cask_packages 117 | register: cask_result 118 | - name: cask パッケージの情報保存先ディレクトリを作成 119 | file: path=cask_info state=directory 120 | - name: cask パッケージの情報を保存 121 | shell: brew cask info {{ item }} > cask_info/{{ item }} 122 | with_items: cask_result.results | selectattr('changed') | map(attribute='item') | map(attribute='name') | list 123 | 124 | # oh-my-zsh 125 | - name: oh-my-zsh のインストール 126 | shell: curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh 127 | args: 128 | creates: ~/.oh-my-zsh/ 129 | 130 | # Ricty 131 | - name: xquartz のインストール (for Ricty) 132 | homebrew_cask: name=xquartz 133 | - name: fontforge のインストール (for Ricty) 134 | homebrew: name=fontforge 135 | - name: Ricty のインストール 136 | homebrew: name=ricty 137 | - name: 生成されたフォントファイルをコピー 138 | shell: cp -f $(brew --cellar ricty)/*/share/fonts/Ricty*.ttf ~/Library/Fonts/ 139 | args: 140 | creates: ~/Library/Fonts/Ricty-Bold.ttf 141 | notify: run fc-cache 142 | 143 | handlers: 144 | - name: run fc-cache 145 | shell: fc-cache -vf 146 | --------------------------------------------------------------------------------