Skip to content

Commit

Permalink
Fix vagrant networking configuration
Browse files Browse the repository at this point in the history
With a fresh install of Vagrant 2.0.1, and
VirtualBox 5.2.2r119230 on OSX the vagrant config
failed.  In particular the host machine was unable
to connect via ssh because the network to the VM
was unreachable.

I changed some of the extra config options passed
to VirtualBox for network config and it solved the issue.

In addition there were a some path issues -- it looks like
the build.sh script has changed and needs to be able to
run a `git revlist` to build the package.
  • Loading branch information
gtowey committed Nov 30, 2017
1 parent 6fe7bc0 commit 486860f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
15 changes: 8 additions & 7 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,21 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = BOX
config.vm.box_download_insecure = true
config.vm.box_check_update = false
config.vm.provider 'virtualbox' do |vb|
vb.customize ['modifyvm', :id, '--nictype1', 'virtio']
vb.customize ['modifyvm', :id, '--nictype2', 'virtio']
end
# config.vm.provider 'virtualbox' do |vb|
# vb.customize ['modifyvm', :id, '--nictype1', 'virtio']
# vb.customize ['modifyvm', :id, '--nictype2', 'virtio']
# end

config.vm.synced_folder '.', '/orchestrator', type: 'rsync',
rsync__auto: true,
rsync__exclude: ".git/"
rsync__auto: true

(0..4).each do |n|
name = (n > 0 ? ("db" + n.to_s) : "admin")
config.vm.define name do |db|
db.vm.hostname = name
db.vm.network "private_network", ip: "192.168.57.20" + n.to_s
db.vm.network "private_network", ip: "192.168.57.20" + n.to_s,
virtualbox__inet: true

db.vm.provision "shell", path: "vagrant/base-build.sh"
if name == "admin"
db.vm.network "forwarded_port", guest:3000, host:3000
Expand Down
8 changes: 5 additions & 3 deletions vagrant/base-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ if [[ -e /etc/redhat-release ]]; then

# All the project dependencies to build plus some utilities
# No reason not to install this stuff in all the places :)
yum -d 0 -y install Percona-Server-server-56 Percona-Server-shared-56 Percona-Server-client-56 Percona-Server-shared-compat percona-toolkit percona-xtrabackup ruby-devel gcc rpm-build git vim-enhanced golang
yum -d 0 -y install Percona-Server-server-56 Percona-Server-shared-56 Percona-Server-client-56 Percona-Server-shared-compat percona-toolkit percona-xtrabackup ruby-devel gcc rpm-build git vim-enhanced golang jq
# newest versions of java aren't compatable with the installed version of ruby (1.8.7)
gem install json --version 1.8.6
# Pin to 1.4 due to 1.5 no longer working on EL6
gem install fpm --version 1.4

Expand Down Expand Up @@ -59,8 +61,8 @@ elif [[ -e /etc/debian_version ]]; then
sudo apt-get -y install percona-toolkit percona-xtrabackup

# All the project dependencies to build
sudo apt-get -y install ruby-dev gcc git rubygems rpm
sudo gem install fpm
sudo apt-get -y install ruby-dev gcc git rubygems rpm jq
gem install fpm

# Go
sudo apt-get -y install golang-go
Expand Down

0 comments on commit 486860f

Please sign in to comment.