/devbox

devbox (savr - super ansible vagrant runner)

Primary LanguageShell

devbox (savr - super ansible vagrant runner)

Needs

VirtualBox, Vagrant, Ansible or if you're on a Mac with homebrew and caskroom:

brew cask install virtualbox
brew cask install virtualbox-extension-pack
brew cask install vagrant
brew install ansible

Setup/Start

Copy provisioning/devbox.yml.dist to provisioning/devbox.yml and configure it as you want.

Case 1: without local ansible installation (e.g. Windows)

Start the ansible- and devbox-VM, then do the provision from the ansible-VM.

Put the Vagrant ssh-key into your ssh-agent. On Windows this is typically made with pageant. You find the key in your home directory .vagrant.d/insecure_private_key.

Please convert this key with pageant before using to a compatible format through the Conversion-feature of pageant!

vagrant up
make init
make devbox

Some background: make devbox copies the ansible-playbook and its roles to the ansible-VM and runs it with a remote-ssh command from there. So the ansible runner connects from within the ansible-VM directly to the devbox-VM. That's the trick, why this case doesn't need a local ansible installation.

Case 2: with local ansible installation (e.g. OSX, Linux)

Put the Vagrant ssh-key into your ssh-agent:

ssh-add ~/.vagrant.d/insecure_private_key

Start the devbox-VM and do the provision from your local machine.

vagrant up devbox
make devbox-local

Post installation

Add following lines to your local /etc/hosts for the default vhosts

10.10.10.5 db.admin.devbox.local
10.10.10.5 info.admin.devbox.local
10.10.10.5 bench.admin.devbox.local
10.10.10.5 test.website.devbox.local
10.10.10.5 test.project.devbox.local

And do following in your devbox-VM, to start the php-fpm:

phpbrew switch php-7.0.11 (or your prefered/installed version)
phpbrew fpm start

Good to know

Configure webserver/fpm ports and PHP versions

Have a look at the provisioning/devbox.yml ...

SSH

Use vagrant ssh ansible (or ... devbox) to connect to your desired VM.

If you just want to use your typical ssh-command, don't forget to put the Vagrant key into your ssh-agent.

After make init you're also able to connect between both machines from each other with ssh devbox or ssh ansible.

Workspaces

If you want to setup a new vhost like hello.website.devbox.local just use the createworkspace tool within your VM.

createworkspace website hello

Or just run createworkspace, it asks you step-by-step.

PHP

If you want to change the version, please stop the fpm before switching!

phpbrew fpm stop
phpbrew switch php-5.6.18
phpbrew fpm start