vagrant-lxc-ng/spec/Vagrantfile
Virgil Dupras 97b5882262 Refactoring: make SudoWrapper a bit more self-contained
By looking at the code, it seems that it was a goal to make the sudo
wrapper path configurable through the Vagrantfile, but it wasn't
effective and didn't make much sense (that kind of config is a per-host
config, not a per-guest one).

This caused the cause to be needlessly complex by giving the Provider
the responsibility of instanciating the wrapper. This commit gets rid of
that.

I didn't get rid of `sudo_wrapper` injection in `Driver` and
`Driver::CLI` constructors because they're needed for tests. I'm not
ready to tackle this yet.
2018-01-13 08:32:27 -05:00

26 lines
801 B
Ruby

# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.require_plugin 'vagrant-lxc'
Vagrant.require_plugin 'vagrant-cachier'
ENV['BOX_NAME'] ||= 'quantal64'
puts "Running vagrant commands using #{ENV['BOX_NAME']} box"
Vagrant.configure("2") do |config|
config.vm.box = ENV['BOX_NAME']
config.vm.hostname = 'lxc-test-box'
config.vm.box_url = ENV['BOX_URL']
config.vm.network :forwarded_port, guest: 80, host: 8080
config.cache.auto_detect = true
config.vm.provision :shell,
inline: 'mkdir -p /vagrant/tmp && echo -n "Provisioned" > /vagrant/tmp/provisioning'
config.vm.provision :shell,
inline: 'apt-get install apache2 -y'
config.vm.provision :shell, privileged: false,
inline: "if ! [ -f $HOME/original-box ]; then echo '#{ENV['BOX_NAME']}' > $HOME/original-box; fi"
end