Remove box image cache from setup script and fix vagrant keys path

This commit is contained in:
Fabio Rehm 2013-03-02 23:33:30 -03:00
parent 7b68802dd2
commit 91c9c059ff

View file

@ -1,5 +1,12 @@
#!/usr/bin/env ruby
# I know, we should be using something like puppet or chef but trust me, this
# started as a small script :-)
# Please check https://github.com/fgrehm/vagrant-lxc/issues/7 for the current status.
# In case something goes wrong after the machine has been set up, you can run this
# script again and it will ask you if you want to restore a clean snapshot.
raise 'You should not run this script from the dev box' if ENV['USER'] == 'vagrant'
require 'bundler'
@ -119,12 +126,9 @@ vagrant_ssh 'sudo chown vagrant:vagrant /etc/rinetd.conf'
vagrant_ssh 'cd /vagrant && bundle && cd /vagrant/dev && bundle'
# Setup vagrant default ssh key
vagrant_keys_path = '/vagrant/vagrant/keys'
vagrant_keys_path = '/vagrant/vendor/vagrant/keys'
vagrant_ssh "mkdir -p ~/.ssh && cd /vagrant && cp #{vagrant_keys_path}/vagrant ~/.ssh/id_rsa && cp #{vagrant_keys_path}/vagrant.pub ~/.ssh/id_rsa.pub && chmod 600 ~/.ssh/id_rsa"
# Setup lxc cache
vagrant_ssh "sudo mkdir -p /var/cache/lxc/cloud-quantal && sudo cp /vagrant/cache/#{IMAGE_NAME} /var/cache/lxc/cloud-quantal/#{IMAGE_NAME}"
# Click
sh 'vagrant halt'
conf = JSON.parse File.read('.vagrant')