Vagrant files to create a Rancher server and host environment for local development
Requirements
- Vagrant (with Virtualbox plugin)
- Virtualbox
Tested using the following desktop deployment environments
- Ubuntu 17.04 (Desktop)
- macOS Sierra 10.12.6 (Desktop)
Tested using the following Rancher, Vagrant and Docker versions
- Rancher Server v1.6.7
- Rancher Agent v1.2.6
- CentOS 7 (Vagrantbox)
- Docker-CE v17.06.0
Usage Instructions
- Clone the repo
- Run
sudo vagrant plugin install vagrant-vbguest
(to ensure host/guest VBox additions are matched) - Run
vagrant up
from within /server - After the instance is launched wait for 3-4 minutes until the Rancher server is up
- Access the Rancher sever at http://192.168.50.50:8080
- Go to infrastructure > hosts > add host
- Accept the default host reg URL
- Copy the (long) host reg string
- Update the entry in host.sh with the new token (i.e
08E7A124D98AB02233F1:1483142400000:rBrLKo9bzo1qSZfeu1I3UrsXc8
) - Run
vagrant up
from within /host - Check the new host has launched and registered in the Rancher server
Note 1: To persist the environment prior to PC or laptop suspend and/or shutdown/reboot:
Either..
- Pause both the server and host nodes from within the Virtualbox UI
Or..
- (Recommended) Issue a
vagrant suspend
for both /server and /host, followed by avagrant resume
.
Note 2: Guest to Host time sync:
To keep the guest time in sync with the host after a suspend/resume, ensure that Virtualbox Guest Additions are installed and update the locale string for /usr/share/zoneinfo
in the Vagrantfile(s) for both server and host (This is currently set to /Europe/London
).