Skip to content

Instantly share code, notes, and snippets.

@mamor
Last active December 29, 2015 04:29
Show Gist options
  • Save mamor/7615663 to your computer and use it in GitHub Desktop.
Save mamor/7615663 to your computer and use it in GitHub Desktop.
knife-solo実行環境を用意するためのVagrantfileのdiff。/home/vagrant/.chef/knife.rbはtemplateで別途用意する必要がある。config.vm.synced_folderは設定する必要無いけど設定しない理由もないのでついでに。
diff --git a/Vagrantfile b/Vagrantfile
index 11320e1..6eee250 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -10,11 +10,11 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# please see the online documentation at vagrantup.com.
# Every Vagrant virtual environment requires a box to build off of.
- config.vm.box = "base"
+ config.vm.box = "ubuntu1304"
# The url from where the 'config.vm.box' box will be fetched if it
# doesn't already exist on the user's system.
- # config.vm.box_url = "http://domain.com/path/to/above.box"
+ config.vm.box_url = "http://cloud-images.ubuntu.com/raring/current/raring-server-cloudimg-vagrant-amd64-disk1.box"
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
@@ -38,7 +38,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
- # config.vm.synced_folder "../data", "/vagrant_data"
+ config.vm.synced_folder "share", "/share", :create => true, :mount_options => ["dmode=777", "fmode=777"]
# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
@@ -82,6 +82,8 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# path, and data_bags path (all relative to this Vagrantfile), and adding
# some recipes and/or roles.
#
+ config.vm.provision :shell, :inline => "apt-get install ruby-dev --no-upgrade -y"
+ config.vm.provision :shell, :inline => "gem install chef knife-solo --no-rdoc --no-ri --conservative"
# config.vm.provision :chef_solo do |chef|
# chef.cookbooks_path = "../my-recipes/cookbooks"
# chef.roles_path = "../my-recipes/roles"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment