From 3e608907cbb70cbf003e8381c950e60e54c69fd4 Mon Sep 17 00:00:00 2001 From: Chip Warden Date: Thu, 11 Jun 2015 22:18:54 -0500 Subject: [PATCH] Switched to "official" debian/jessie64 box. --- AUTHORS | 1 + Vagrantfile | 35 ++++++++++++++++++++++++++++++++--- provision.sh | 2 ++ 3 files changed, 35 insertions(+), 3 deletions(-) diff --git a/AUTHORS b/AUTHORS index e049345..624364f 100644 --- a/AUTHORS +++ b/AUTHORS @@ -2,5 +2,6 @@ Steven Cummings Julia Elman Matthew Irish Mark Ransom +Jon Smajda Jeff Triplett Chip Warden diff --git a/Vagrantfile b/Vagrantfile index 6e395fa..3dc1f4b 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -3,6 +3,26 @@ VAGRANTFILE_API_VERSION = "2" +# Allow host platform checks +# http://stackoverflow.com/questions/26811089/vagrant-how-to-have-host-platform-specific-provisioning-steps +module OS + def OS.windows? + (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil + end + + def OS.mac? + (/darwin/ =~ RUBY_PLATFORM) != nil + end + + def OS.unix? + !OS.windows? + end + + def OS.linux? + OS.unix? and not OS.mac? + end +end + Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # vagrant-hostmanager plugin is required @@ -15,13 +35,22 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| raise 'vagrant-hostsupdater is not installed. run: vagrant plugin install vagrant-hostsupdater' end + # vagrant-vbguest plugin is required + unless Vagrant.has_plugin?("vagrant-vbguest") + raise'vagrant-vbguest is not installed. run: vagrant plugin install vagrant-vbguest' + end + config.vm.define "pykcdotdev" do |pykcdotdev| pykcdotdev.vm.box = "debian/jessie64" pykcdotdev.vm.hostname = "pythonkc.dev" pykcdotdev.vm.network "private_network", ip: "192.168.100.101" - pykcdotdev.vm.synced_folder "./", "/vagrant/" - pykcdotdev.vm.synced_folder "./pythonkc_site", "/var/www/pythonkc_site" - # TODO: Create a synced folder location for Ansible playbooks + if OS.unix? + pykcdotdev.vm.synced_folder "./", "/vagrant/", type: "nfs" + elsif OS.windows? + pykcdotdev.vm.synced_folder "./", "/vagrant/" # , type: "smb" + else + raise 'Unknown host operating system. Cannot continue.' + end pykcdotdev.vm.provider "virtualbox" do |vb| vb.name = "pykcdotdev" diff --git a/provision.sh b/provision.sh index b2398c8..2896ffa 100644 --- a/provision.sh +++ b/provision.sh @@ -8,6 +8,8 @@ aptitude dist-upgrade -y aptitude install build-essential -y aptitude install linux-headers-amd64 -y ln -sf /vagrant /home/vagrant/ +mkdir -p /var/www +ln -sf /vagrant/pythonkc_site /var/www/pythonkc_site if [[ -z "$(which ansible)" ]]; then echo "Installing Ansible..."