diff --git a/development/Vagrantfile b/development/Vagrantfile index 3286904..f2188c2 100644 --- a/development/Vagrantfile +++ b/development/Vagrantfile @@ -30,13 +30,6 @@ Vagrant.configure("2") do |config| lxc.start_opts << 'lxc.aa_profile=unconfined' end - config.vm.provision :shell, inline: ' - if ! [ -f /home/vagrant/.updated ]; then - sudo apt-get update && - sudo apt-get install puppet -y && - touch /home/vagrant/.updated - fi' - config.vm.provision :puppet do |puppet| puppet.manifests_path = "." puppet.manifest_file = "site.pp" diff --git a/development/lxc-configs/lxc-dev-default b/development/lxc-configs/lxc-dev-default index 4ad1a6d..2d66a5e 100644 --- a/development/lxc-configs/lxc-dev-default +++ b/development/lxc-configs/lxc-dev-default @@ -27,7 +27,7 @@ USE_LXC_BRIDGE="true" # name. # If you have the dnsmasq daemon installed, you'll also have to update # /etc/dnsmasq.d/lxc and restart the system wide dnsmasq daemon. -LXC_BRIDGE="lxcbr1" +LXC_BRIDGE="lxcbr0" LXC_ADDR="10.0.254.1" LXC_NETMASK="255.255.255.0" LXC_NETWORK="10.0.254.0/24" diff --git a/development/setup-lxc-dev-box b/development/setup-lxc-dev-box index 01f148a..a400e32 100755 --- a/development/setup-lxc-dev-box +++ b/development/setup-lxc-dev-box @@ -2,9 +2,9 @@ set -e -# Package ubuntu-cloud -if ! [ -f ../boxes/output/ubuntu-cloud.box ]; then - bundle exec rake boxes:build:ubuntu-cloud +# Package quantal64 +if ! [ -f ../boxes/output/lxc-quantal64.box ]; then + bundle exec rake boxes:quantal64:build fi # Fresh start @@ -13,12 +13,7 @@ bundle exec vagrant-lxc destroy # Skip provisioning as we need to apt-get update first bundle exec vagrant-lxc up --provider=lxc --no-provision -# Trigger an update from here instead of doing it from puppet as we don't need to -# apt-get update every time we boot the container. If there is a way to do it -# from puppet I don't know. If you do, feel free to send a pull request ;) -bundle exec vagrant-lxc ssh -c ' -sudo sed -i -e "s/archive./br.archive./g" /etc/apt/sources.list && -sudo apt-get update' +bundle exec vagrant-lxc ssh -c 'sudo apt-get update && sudo apt-get install puppet -y' bundle exec vagrant-lxc provision # Reload the container just to ensure it can boot properly after the upgrades diff --git a/development/site.pp b/development/site.pp index e836f86..fa64b55 100644 --- a/development/site.pp +++ b/development/site.pp @@ -2,11 +2,11 @@ Exec { path => [ '/bin/', '/sbin/' , '/usr/bin/', '/usr/sbin/', '/usr/local/bin' # Because I'm lazy ;) exec { - 'echo "alias be=\"bundle exec\"" >> ~/.bashrc': - unless => 'grep -q "bundle exec" ~/.bashrc'; + 'echo "alias be=\"bundle exec\"" >> /home/vagrant/.bashrc': + unless => 'grep -q "bundle exec" /home/vagrant/.bashrc'; - 'echo "cd /vagrant" >> ~/.bashrc': - unless => 'grep -q "cd /vagrant" ~/.bashrc'; + 'echo "cd /vagrant" >> /home/vagrant/.bashrc': + unless => 'grep -q "cd /vagrant" /home/vagrant/.bashrc'; } # Overwrite LXC default configs @@ -15,12 +15,13 @@ exec { # We need to do this otherwise IPs will collide with the host's lxc dhcp server. # If we install the package prior to setting this configs the container will go crazy. command => 'cp /vagrant/development/lxc-configs/lxc-dev-default /etc/default/lxc', - unless => 'grep -q "10.0.4" /etc/default/lxc' + unless => 'grep -q "10.0.254" /etc/default/lxc' } # Install dependencies package { - [ 'libffi-dev', 'bsdtar', 'exuberant-ctags', 'ruby1.9.1-dev', 'htop', 'git', 'build-essential' ]: + [ 'libffi-dev', 'bsdtar', 'exuberant-ctags', 'ruby1.9.1-dev', 'htop', 'git', + 'build-essential', 'dnsutils' ]: ensure => 'installed' ; diff --git a/example/Vagrantfile b/example/Vagrantfile index 90ab563..313e190 100644 --- a/example/Vagrantfile +++ b/example/Vagrantfile @@ -7,11 +7,11 @@ Vagrant.configure("2") do |config| config.vm.box = "quantal64" config.vm.box_url = 'http://dl.dropbox.com/u/13510779/lxc-quantal64-2013-03-08.box' config.vm.hostname = 'lxc-quantal64' - config.vm.network :private_network, ip: "192.168.33.10" config.vm.synced_folder "/tmp", "/vagrant_data" config.vm.provider :lxc do |lxc| + lxc.lxc_dhcp_ip = '10.0.254.1' if ENV['USER'] == 'vagrant' lxc.start_opts << 'lxc.cgroup.memory.limit_in_bytes=400M' lxc.start_opts << 'lxc.cgroup.memory.memsw.limit_in_bytes=500M' end diff --git a/example/puppet/manifests/site.pp b/example/puppet/manifests/site.pp index 22446c1..947b061 100644 --- a/example/puppet/manifests/site.pp +++ b/example/puppet/manifests/site.pp @@ -3,4 +3,3 @@ Exec { path => [ '/bin/', '/sbin/' , '/usr/bin/', '/usr/sbin/'] } notice "Hi there! puppet here" require hello_world -