From 72c14740e94905e94d807a37727e4ebfa25d645a Mon Sep 17 00:00:00 2001 From: "T. Kim Nguyen" Date: Sun, 17 Mar 2019 09:41:55 -0500 Subject: [PATCH] add vagrant port forwarding and ssh info as per https://github.com/plone/ansible-playbook/issues/76 --- docs/vagrant.rst | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/docs/vagrant.rst b/docs/vagrant.rst index b02fcfd..2aaf04f 100644 --- a/docs/vagrant.rst +++ b/docs/vagrant.rst @@ -40,8 +40,23 @@ to remove the old host key, then try again. This should not happen if you're using the generated vbox_host.cfg, as it turns of Ansible's host key checking. -Testing -------- +Using the Vagrant +----------------- + +To use your Vagrant, you must use SSH. + +Vagrant maps host ports into the guest VirtualBox OS. + +The standard mapping takes host port 2222 to the guest's SSH port, 22. + +To SSH to your Vagrant: + +.. code-block:: bash + + vagrant ssh + +Port Mapping +------------ Vagrant maps host ports into the guest VirtualBox OS. The standard mapping takes host port 2222 to the guest's SSH port, 22. @@ -49,8 +64,19 @@ The Vagrantfile included with this kit maps several more ports. The general rule config.vm.network "forwarded_port", guest: 80, host: 1080 config.vm.network "forwarded_port", guest: 1080, host: 2080 + config.vm.network "forwarded_port", guest: 4949, host: 5949 config.vm.network "forwarded_port", guest: 6081, host: 7081 config.vm.network "forwarded_port", guest: 8080, host: 9080 - config.vm.network "forwarded_port", guest: 4949, host: 5949 + +You can find these forwarded port settings by opening VirtualBox, selecting your Vagrant (will be called something like `ansible-playbook`), right-clicking, choosing "Settings", clicking "Network", expanding the "Advanced" widget, and clicking the button "Port Forwarding". + +Here is what the forwarded ports are used for and where they are defined: + +- 80, 443: nginx (`roles/nginx/templates/host.j2`) +- 1080: haproxy (`roles/haproxy/defaults/main.yml`) +- 4949: munin_node (`roles/munin-node/defaults/main.yml`) +- 6081: varnish (`roles/varnish/defaults/main.yml`) +- 8100: zeo_port (`roles/plone.plone_server/defaults/main.yml`) +- 8081: client_base_port (`roles/plone.plone_server/defaults/main.yml`) Note that when you use host port 1080 to connect to guest port 80, the virtual hosting will not work correctly. You'll get the homepage, but links -- including those to stylesheets and JS resources, will be wrong. So, you can't really test virtual host rewriting via Vagrant.