2013-02-25 23:14:10 +00:00
|
|
|
# -*- mode: ruby -*-
|
|
|
|
# vi: set ft=ruby :
|
|
|
|
|
2013-03-03 02:34:48 +00:00
|
|
|
Vagrant.require_plugin 'vagrant-lxc'
|
2013-02-25 23:14:10 +00:00
|
|
|
|
2013-03-02 19:51:28 +00:00
|
|
|
Vagrant.configure("2") do |config|
|
2013-03-03 05:37:34 +00:00
|
|
|
config.vm.box = "ubuntu-cloud"
|
|
|
|
config.vm.hostname = 'ubuntu-cloud-box'
|
|
|
|
|
2013-03-04 01:42:18 +00:00
|
|
|
config.vm.synced_folder "/tmp", "/vagrant_data"
|
|
|
|
|
2013-03-02 19:51:28 +00:00
|
|
|
config.vm.provider :lxc do |lxc|
|
2013-03-03 07:37:07 +00:00
|
|
|
lxc.start_opts << 'lxc.cgroup.memory.limit_in_bytes=400M'
|
|
|
|
lxc.start_opts << 'lxc.cgroup.memory.memsw.limit_in_bytes=500M'
|
2013-03-02 19:51:28 +00:00
|
|
|
end
|
2013-03-04 04:14:38 +00:00
|
|
|
|
|
|
|
config.vm.provision :shell, :inline => <<-SCRIPT
|
|
|
|
echo "Hi there I'm the shell script used for provisioning"
|
|
|
|
if `which puppet > /dev/null`; then
|
|
|
|
echo "Looks like puppet has already been installed, moving on"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
echo "I'm about to install puppet!"
|
|
|
|
sleep 1
|
|
|
|
echo "Hang tight, I just need to wait for a while since vagrant-lxc is not handling network properly ;)"
|
|
|
|
sleep 5
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install puppet -y
|
|
|
|
SCRIPT
|
|
|
|
|
|
|
|
config.vm.provision :puppet do |puppet|
|
|
|
|
puppet.module_path = "puppet/modules"
|
|
|
|
puppet.manifests_path = "puppet/manifests"
|
|
|
|
puppet.manifest_file = "site.pp"
|
|
|
|
# If you want to make some noise
|
|
|
|
# puppet.options << [ '--verbose', '--debug' ]
|
|
|
|
end
|
2013-02-25 23:14:10 +00:00
|
|
|
end
|