Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

Latest commit

 

History

History

vagrant

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Yet another Vagrant environment

Requirements

  • Vagrant
  • Vagrant plugins:
    • vagrant-disksize
  • ansible

Preparing for MacOS

  1. Install brew on macOS https://brew.sh/
  2. Install vagrant: brew install --cask vagrant
  3. Install VirtualBox: brew install --cask virtualbox
  4. Install ansible: brew install ansible
  5. Install vagrant plugins: vagrant plugin install vagrant-disksize

Install Telekube on Vagrant

Change working directory to vagrant folder and execute:

$ cd vagrant
$ vagrant up

This will bring 3 VMs properly configured for development

Build gravity and prepare tarball

$ make production telekube

Install telekube

$ cd vagrant
$ make ansible-install

Install gravity from custom tarball

$ cd vagrant
$ ANSIBLE_FLAGS='--extra-vars "gravity_archive_url=https://get.gravitational.com/gravity-7.0.28-linux-x86_64-bin.tar.gz tarball_path=/full/path/to/tarball.tar"'
$ ANSIBLE_FLAGS=$ANSIBLE_FLAGS make ansible-install

Redeploy just Gravity

To update binaries on all hosts (e.g. during development), do the following:

$ cd vagrant
$ make ansible-update-gravity

Redeploy Gravity to remote hosts

If you have deployed somewhere else, it is handy to update binaries on remote hosts.

You can use the same targets with remote hosts as well using remote- prefixes that will generate remote inventories instead.

REMOTE_USER=centos REMOTE_KEY=~/.ssh/ops.pem REMOTE_HOSTS="34.211.109.240" make remote-update-gravity

Test full upgrade

make production telekube
make ansible-upgrade

Using Sandbox

Sandbox is handy when troubleshooting specific operation such as upgrade with frequent need to rollback to original state.

Install required plugins

vagrant plugin install fog-libvirt sahara

Save current state

vagrant suspend && vagrant sandbox on && vagrant resume

Rollback to original state

vagrant suspend && vagrant sandbox rollback && vagrant resume

Note that it will also rollback localtime on nodes.