Skip to content

Commit b8deed8

Browse files
committed
Merge pull request #16 from pythonkc/jessie64
Changed to "official" debian/jessie64 box.
2 parents 783a40a + 2b2aff5 commit b8deed8

File tree

4 files changed

+43
-8
lines changed

4 files changed

+43
-8
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@ Steven Cummings
22
Julia Elman
33
Matthew Irish
44
Mark Ransom
5+
Jon Smajda
56
Jeff Triplett
67
Chip Warden

README.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Files for the PythonKC.com website.
66

77
```
88
vagrant plugin install vagrant-hostmanager
9-
vagrant plugin install vagrant-vbguest
9+
vagrant plugin install vagrant-hostsupdater
1010
vagrant up
1111
```
1212

Vagrantfile

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,54 @@
33

44
VAGRANTFILE_API_VERSION = "2"
55

6+
# Allow host platform checks
7+
# http://stackoverflow.com/questions/26811089/vagrant-how-to-have-host-platform-specific-provisioning-steps
8+
module OS
9+
def OS.windows?
10+
(/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil
11+
end
12+
13+
def OS.mac?
14+
(/darwin/ =~ RUBY_PLATFORM) != nil
15+
end
16+
17+
def OS.unix?
18+
!OS.windows?
19+
end
20+
21+
def OS.linux?
22+
OS.unix? and not OS.mac?
23+
end
24+
end
25+
626
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
727

828
# vagrant-hostmanager plugin is required
929
unless Vagrant.has_plugin?("vagrant-hostmanager")
1030
raise 'vagrant-hostmanager is not installed. run: vagrant plugin install vagrant-hostmanager'
1131
end
1232

33+
# vagrant-hostsupdater plugin is required
34+
unless Vagrant.has_plugin?("vagrant-hostsupdater")
35+
raise 'vagrant-hostsupdater is not installed. run: vagrant plugin install vagrant-hostsupdater'
36+
end
37+
1338
# vagrant-vbguest plugin is required
1439
unless Vagrant.has_plugin?("vagrant-vbguest")
15-
raise 'vagrant-vbguest is not installed. run: vagrant plugin install vagrant-vbguest'
40+
raise'vagrant-vbguest is not installed. run: vagrant plugin install vagrant-vbguest'
1641
end
1742

1843
config.vm.define "pykcdotdev" do |pykcdotdev|
19-
pykcdotdev.vm.box = "box-cutter/debian81"
44+
pykcdotdev.vm.box = "debian/jessie64"
2045
pykcdotdev.vm.hostname = "pythonkc.dev"
2146
pykcdotdev.vm.network "private_network", ip: "192.168.100.101"
22-
pykcdotdev.vm.synced_folder "./", "/vagrant/"
23-
pykcdotdev.vm.synced_folder "./pythonkc_site", "/var/www/pythonkc_site"
24-
# TODO: Create a synced folder location for Ansible playbooks
47+
if OS.unix?
48+
pykcdotdev.vm.synced_folder "./", "/vagrant/", type: "nfs"
49+
elsif OS.windows?
50+
pykcdotdev.vm.synced_folder "./", "/vagrant/" # , type: "smb"
51+
else
52+
raise 'Unknown host operating system. Cannot continue.'
53+
end
2554

2655
pykcdotdev.vm.provider "virtualbox" do |vb|
2756
vb.name = "pykcdotdev"

provision.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,16 @@
33

44
export DEBIAN_FRONTEND=noninteractive
55

6+
aptitude update
7+
aptitude dist-upgrade -y
8+
aptitude install build-essential -y
9+
aptitude install linux-headers-amd64 -y
610
ln -sf /vagrant /home/vagrant/
11+
mkdir -p /var/www
12+
ln -sf /vagrant/pythonkc_site /var/www/pythonkc_site
713

814
if [[ -z "$(which ansible)" ]]; then
9-
echo "Installing ansible"
10-
aptitude update
15+
echo "Installing Ansible..."
1116
aptitude install -y python3 python3-dev python3-pip ansible
1217
fi
1318

0 commit comments

Comments
 (0)