Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
benc committed Jun 20, 2015
0 parents commit 4394951
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.vagrant
27 changes: 27 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
require 'yaml'

Vagrant.configure("2") do |config|
config.vm.box = "yosemite"
config.ssh.insert_key = false
# config.ssh.private_key_path = ["#{ENV['HOME']}/.ssh/id_rsa","#{ENV['HOME']}/.vagrant.d/insecure_private_key"]

# Build blog platform
config.vm.provider :vmware_fusion do |provider, override|
provider.vmx["memsize"] = "1024"
provider.vmx["mks.enable3d"] = "FALSE"
provider.vmx["mks.vsync"] = "1"
provider.gui = false
end

# config.vm.provision :shell, inline: <<-SCRIPT
# printf "%s\n" "#{File.read("#{ENV['HOME']}/.ssh/id_rsa.pub")}" > /home/vagrant/.ssh/authorized_keys
# chown -R vagrant:vagrant /home/vagrant/.ssh
# SCRIPT

config.vm.provision :ansible do |ansible|
ansible.playbook = "development_machine.yml"
ansible.sudo = true
ansible.host_key_checking = false
ansible.verbose = 'v'
end
end
5 changes: 5 additions & 0 deletions development_machine.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
- hosts: all
sudo: false
roles:
- role: development
11 changes: 11 additions & 0 deletions roles/development/tasks/bootstrap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
- name: Install XCode command line tools
shell: xcode-select --install
args:
creates: /usr/bin/gcc
sudo: true

- name: Install homebrew
shell: ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" </dev/null
args:
creates: /usr/local/bin/brew
20 changes: 20 additions & 0 deletions roles/development/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
- include: bootstrap.yml

- name: Install rbenv
homebrew: name={{item}} state=present
with_items:
- rbenv
- ruby-build
- ruby-install

- name: Install rubies
command: rbenv install {{ item }} --keep
args:
creates: "{{ansible_env.HOME}}/.rbenv/versions/{{ item }}"
with_items:
- 1.9.3-p484
- 2.2.2
environment:
PATH: "/usr/local/bin:{{ ansible_env.PATH }}"
CC: /usr/bin/gcc

0 comments on commit 4394951

Please sign in to comment.