Skip to content
Merged
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
32 changes: 16 additions & 16 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,31 @@
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
Vagrant.configure('2') do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.

# Every Vagrant development environment requires a box. You can search for
# boxes at https://atlas.hashicorp.com/search.
config.vm.box = "ubuntu/xenial64"
config.vm.box = 'ubuntu/xenial64'

# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine and only allow access
# via 127.0.0.1 to disable public access
config.vm.network "forwarded_port", guest: 7474, host: 7474, host_ip: "127.0.0.1"
config.vm.network "forwarded_port", guest: 7473, host: 7473, host_ip: "127.0.0.1"
config.vm.network "forwarded_port", guest: 7472, host: 7472, host_ip: "127.0.0.1"
config.vm.network 'forwarded_port', guest: 7474, host: 9474, host_ip: '127.0.0.1'
config.vm.network 'forwarded_port', guest: 7473, host: 9473, host_ip: '127.0.0.1'
config.vm.network 'forwarded_port', guest: 7472, host: 9472, host_ip: '127.0.0.1'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should not have committed this host port change

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, I just put them back


# Share an additional folder to the guest VM or configure . The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.

project_name = "neo4j"
fail "Vagrantfile project_name variable cannot be blank" if project_name.nil? || project_name == ""
project_name = 'neo4j'
fail 'Vagrantfile project_name variable cannot be blank' if project_name.nil? || project_name == ''

config.vm.synced_folder ".", "/home/ubuntu/#{project_name}"
config.vm.synced_folder '.', "/home/ubuntu/#{project_name}"

# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
Expand All @@ -48,16 +48,16 @@ Vagrant.configure("2") do |config|

# Disable notify-forwarder plugin, if present, because it was messing with Neo4j and causing a database panic
# https://discuss.elastic.co/t/es-cluster-in-docker-containers-alreadyclosedexception-underlying-file-changed-by-an-external-force/48874/8
if Vagrant.has_plugin?("vagrant-notify-forwarder")
if Vagrant.has_plugin?('vagrant-notify-forwarder')
config.notify_forwarder.enable = false
end

# Enable provisioning with a shell script. Additional provisioners such as
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
# documentation for more information about their specific syntax and use.

config.vm.provision "bootstrapping", type: "shell", privileged: false,
keep_color: true, inline: <<-SHELL
config.vm.provision 'bootstrapping', type: 'shell', privileged: false,
keep_color: true, inline: <<-SHELL
PURPLE='\033[1;35m'; GREEN='\033[1;32m'; NC='\033[0;0m'
echo "${PURPLE}BEGINNING BOOTSTRAPPING PROCESS...Grab a drink. This could take a while.${NC}"
echo ' '
Expand Down Expand Up @@ -101,7 +101,7 @@ Vagrant.configure("2") do |config|
echo "${GREEN}COMPLETED INSTALLING GEMS${NC}"
SHELL

unless Dir["./db/neo4j/development"].any?
unless Dir['./db/neo4j/development'].any?
# With default configuration, Neo4j only accepts local connections (which, in this case, means local to the VM).
# Vagrant has been set up to forward connections local to the VM to the appropriate ports on the host machine.
# As such, we need to change neo4j's conf to accept non-local connections if we want to be able to connect to
Expand Down Expand Up @@ -129,8 +129,8 @@ Vagrant.configure("2") do |config|
FileUtils.mv(t_file.path, './db/neo4j/development/conf/neo4j.conf')
TEXT

config.vm.provision "install neo4j", type: "shell", privileged: false,
keep_color: true, inline: <<-SHELL
config.vm.provision 'install neo4j', type: 'shell', privileged: false,
keep_color: true, inline: <<-SHELL
PURPLE='\033[1;35m'; GREEN='\033[1;32m'; NC='\033[0;0m'
echo "${PURPLE}INSTALLING NEO4J INTO 'db/neo4j/development'${NC}"
cd ~/#{project_name}
Expand All @@ -140,8 +140,8 @@ Vagrant.configure("2") do |config|
SHELL
end

config.vm.provision "bootstrapping complete", type: "shell", privileged: false,
keep_color: true, run: "always", inline: <<-SHELL
config.vm.provision 'bootstrapping complete', type: 'shell', privileged: false,
keep_color: true, run: 'always', inline: <<-SHELL
GREEN="\033[1;32m"; BLUE='\033[1;34m'; NC="\033[0;0m"
echo "${GREEN}BOOTSTRAPPING COMPLETE!${NC}"
echo "${BLUE}Database server not started${NC}"
Expand Down