Created
May 18, 2015 07:13
-
-
Save gin0606/25f1b59e8a6602a758b9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Command Line Toolsが入っているかの確認 | |
stat: path=/usr/include | |
register: command_line_tools_dir | |
- name: Command Line Toolsが入っていなかったらインストールする | |
shell: | | |
PLACEHOLDER=/tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress | |
touch $PLACEHOLDER | |
PROD=$(softwareupdate -l | grep "\*.*Command Line" | head -n 1 | awk -F"*" '{print $2}' | sed -e 's/^ *//' | tr -d '\n') | |
softwareupdate -i "${PROD}" | |
[[ -f $PLACEHOLDER ]] && rm $PLACEHOLDER | |
when: not command_line_tools_dir.stat.exists | |
- stat: path=~/.bash_profile | |
register: bash_profile | |
- file: path=~/.bash_profile state=touch | |
when: not bash_profile.stat.exists | |
- name: homebrewが入っているかの確認 | |
stat: path=/usr/local/bin/brew | |
register: brew_command | |
- name: homebrewが入っていなかったらインストールする | |
shell: echo '\n' | ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
when: not brew_command.stat.exists | |
- shell: cp -r /vagrant/caches/homebrew/* /Library/Caches/Homebrew || true | |
- homebrew: update_homebrew=yes | |
- homebrew_tap: tap=caskroom/cask state=present | |
- homebrew: name=brew-cask | |
- homebrew_tap: tap={{ item }} state=present | |
with_items: homebrew.tap | |
- homebrew_cask: name={{ item }} | |
with_items: homebrew.cask | |
- homebrew: name={{ item }} | |
with_items: homebrew.formula | |
- name: rbenv関係のformulaをインストールする | |
homebrew: name={{ item }} | |
with_items: | |
- rbenv | |
- ruby-build | |
- rbenv-gem-rehash | |
- lineinfile: dest=~/.bash_profile line='if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' | |
- lineinfile: dest=~/.bash_profile line='export PATH=$HOME/.rbenv/shims:$PATH' | |
- shell: /bin/bash -lc "rbenv install --skip-existing {{ rbenv.global }}" | |
- shell: /bin/bash -lc "rbenv global {{ rbenv.global }}" | |
- gem: name={{ item }} | |
with_items: ruby.gems | |
- shell: cp -r /Library/Caches/Homebrew/* /vagrant/caches/homebrew || true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment