Skip to content

Commit

Permalink
Merge pull request sillsdev#276 from sillsdev/bug/fix-ansible-install
Browse files Browse the repository at this point in the history
Make corrections to the Vagrant install method
  • Loading branch information
irahopkinson authored Jun 2, 2018
2 parents 9e861b8 + f490925 commit f7fba65
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,10 @@ After Ubuntu Xenial Bash has finished installing, close the Windows Command Prom

### Vagrant VM Setup <a id="VagrantSetup"></a> ###

If you are on Windows, begin by giving your user account [permission to create symlinks.](https://gist.github.com/Nateowami/504b7d4c63b53f8e6d21822ddc648e14) This is necessary or `npm install` will not run properly.

- Download the file https://github.com/sillsdev/web-languageforge/blob/master/deploy/xenial/Vagrantfile and save it as Vagrantfile.
- Open the command line to the directory where the Vagrantfile is and run `vagrantup --no-provision` (this delays provisioning so the VirtualBox guest additions updates don't interfere with the provisioning process.)
- Open the command line to the directory where the Vagrantfile is and run `vagrant up --no-provision` (this delays provisioning so the VirtualBox guest additions updates don't interfere with the provisioning process.)
- Shut down the box with `vagrant halt`
- Run `vagrant up --provision`

Expand Down
2 changes: 1 addition & 1 deletion deploy/playbook_xenial_server_vagrant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

- include: dependencies.yml
vars:
deploy: lf_only
deploy: palaso
- include: code.yml
vars:
site_src_paths:
Expand Down
14 changes: 10 additions & 4 deletions deploy/xenial/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ apt-get -y install git ansible
echo Install NodeJS 8.X and latest npm
wget -O- https://deb.nodesource.com/setup_8.x | sudo -E bash -
apt-get install -y nodejs || exit
apt-get install -y nodejs
# Runs the rest of the script as vagrant
sudo -i -u vagrant bash << VAGRANT_USER
Expand All @@ -26,17 +26,19 @@ set -eux
cd ~/src
if [ ! -d "web-languageforge" ]; then
git clone --depth 100 --recurse-submodules https://github.com/sillsdev/web-languageforge.git
git clone --depth 1 --recurse-submodules https://github.com/sillsdev/web-languageforge.git
else
cd web-languageforge
# commented out because it crashes the script if git user.email and user.name are not set, and it is non-critical
# git pull --ff-only --recurse-submodules
git pull --ff-only --recurse-submodules
fi
[ -d web-scriptureforge ] || ln -s web-languageforge web-scriptureforge
cd ~/src/web-languageforge/deploy/
git checkout master
echo '***You may be asked for a password. The password is vagrant***'
ansible-playbook -i hosts playbook_create_config.yml --limit localhost
chown vagrant.vagrant ansible.cfg # TODO: what is this here for?
ansible-playbook -i hosts playbook_xenial_server_vagrant.yml --limit localhost
Expand Down Expand Up @@ -87,6 +89,10 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
vb.customize ["modifyvm", :id, "--memory", "4096"]
vb.customize ["modifyvm", :id, "--vram", 64]
vb.customize ["modifyvm", :id, "--accelerate3d", "off"]

# Allows symlinks in the synced folder (disabled by default because of security issues that don't apply to us)
# See https://github.com/hashicorp/vagrant/issues/713
vb.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/vagrant-root", "1"]
end

# configure Vagrant's ssh shell to be a non-login one (avoids error "stdin: is not a tty error")
Expand Down

0 comments on commit f7fba65

Please sign in to comment.