Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ Steven Cummings
Julia Elman
Matthew Irish
Mark Ransom
Jon Smajda
Jeff Triplett
Chip Warden
35 changes: 32 additions & 3 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions provision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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..."
Expand Down