Skip to content

Instantly share code, notes, and snippets.

@zofrex
Created March 22, 2016 04:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zofrex/e3ee02dc9a1060768910 to your computer and use it in GitHub Desktop.
Save zofrex/e3ee02dc9a1060768910 to your computer and use it in GitHub Desktop.
Vagrantfile for testing CFengine on Ubuntu and FreeBSD
Vagrant.configure(2) do |config|
config.vm.provider "vmware_fusion" do |vmware|
vmware.vmx["memsize"] = "4096"
vmware.vmx["numvcpus"] = "4"
end
config.vm.define "ubuntu" do |ubuntu|
ubuntu.vm.box = "hashicorp/precise64"
ubuntu.vm.provision "shell", privileged: false, inline: <<-SHELL
set -ex
sudo apt-get update
sudo apt-get install -y automake libtool libtokyocabinet-dev libpcre3-dev libpam-dev flex
wget http://invisible-island.net/datafiles/release/byacc.tar.gz
tar -xzf byacc.tar.gz
cd byacc*
./configure
make
sudo make install
cd /vagrant
./autogen.sh --with-tokyocabinet
./configure --with-tokyocabinet
make clean
make
cd tests/acceptance
./testall --printlog --ec=DEBUG 10_files/01_create/perms-mode.cf
SHELL
end
config.vm.define "freebsd" do |freebsd|
freebsd.vm.box = "zofrex/freebsd-personal"
config.vm.synced_folder './', '/home/vagrant/cfengine/',
type: 'rsync', owner: 'vagrant', group: 'vagrant'
freebsd.vm.provision "shell", privileged: false, inline: <<-SHELL
set -ex
cd cfengine
sudo pkg install --yes gmake bash automake libtool tokyocabinet pcre
sudo ln -s /usr/local/bin/bash /bin/bash
./autogen.sh --with-tokyocabinet=/usr/local --with-pcre=/usr/local
./configure --with-tokyocabinet=/usr/local --with-pcre=/usr/local
make clean
make
SHELL
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment