- hosts: localhost # 実行対象のホストを指定
connection: local
gather_facts: no
sudo: no
vars: # インストールしたいものや追加したいリポジトリをここで定義
homebrew_taps:
- caskroom/cask
- sanemat/font
- caskroom/fonts
- rcmdnk/homebrew-rcmdnkcask
homebrew_packages:
- { name: ansible }
- { name: brew-cask }
- { name: colordiff }
- { name: coreutils }
- { name: git }
- { name: python }
- { name: sqlite }
- { name: wget }
- { name: sl }
- { name: zsh }
- { name: openssl, state: linked, install_options: force }
- { name: curl }
- { name: ricty }
- { name: htop-osx }
homebrew_cask_packages:
- { name: sourcetree }
- { name: google-chrome }
- { name: iterm2 }
- { name: google-japanese-ime }
- { name: sublime-text3 }
- { name: textwrangler }
- { name: karabiner }
- { name: seil }
- { name: usb-overdrive }
- { name: day-o }
- { name: the-unarchiver }
- { name: openoffice }
- { name: skitch }
- { name: cakebrew }
- { name: font-m-plus }
- { name: font-migu1m }
- { name: slack }
- { name: forklift }
- { name: atom }
- { name: virtualbox }
- { name: firefox }
tasks: # 実行したい動作をtasksに記述
# brew tap
- name: brew tap
homebrew_tap: tap="{{ item }}" state=present
with_items: homebrew_taps
# update homebrew
- name: brew update
homebrew: update_homebrew=yes
# brew
- name: install brew package
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
# cask
- name: install homebrew-cask
homebrew: name=brew-cask state=latest
- name: install cask package
homebrew_cask: name={{ item.name }} state={{ item.state|default('installed') }}
with_items: homebrew_cask_packages
register: cask_result