SSH jump host example with vagrant

This time shows the tutorial two topics in one. The first topic is: “How an easy to configure SSH host jump”. The 2nd topic is: “Provisioning examples for Vagrant”.

Precondition

  • Vagrant installed
  • VirtualBox installed

File content

Note: Replace values for HostName “192.168.x.x” by real IP from jump_host and KEY_LOCATION “~/.ssh/id_rsa.pub”!

Steps

Minimal CentOS 7 base box with Packer

The title says it, … this tutorial is about Packer, CentOS 7 and Vagrant. After that, you should be able to integrate the creation of Vagrant base boxes into your Build-server. There is on small exception to other – the VirtualBox Guest Additions will be provided via PlugIn! Because other users could may have different versions.

Preconditions

Project structure

File contents

ks content

Usage

Vagrant – Authentication failure

Depending on the vagrant version and how you build/package boxes, you may know the Authentication failure after command “$ vagrant up“. Here now two simple tips, how to prevent or fix it.

Prevention

If you build on an existing box you should not allow Vagrant to automatically insert a new key pair.

Workaround

If the problem already exists…

On command “$ vagrant halt” Vagrant will automatically insert a new keypair.

Real-time log monitoring

You may need to watch different log files on automated test runs. With log.io you can simply monitoring log files via browser! This tutorial shows how easy it is.

Preconditions

Preparation

Create new project with following structure and files.

File contents

Configure your Harvesters…

Configure your log server…

Configure your web server…

Create simple init script…

Usage

Now open your browser with URL http://<ip>:28778

Docker Remote API and CentOS 7

This time again some topics in one tutorial. We touch Vagrant with Shell provision (external script), Docker Remote API and something CentOS 7 configuration.

Preconditions

Preparation

If you already have a CentOS 7 with Docker, you can skip these steps. Create a folder with the following 2 files…

Instructions

Now we edit docker.service file. The path may be different!

Note: Be careful if you use tcp://0.0.0.0:4243 !!!!

Read the manual of jq, the power of curl and jq together is awesome.

Vagrant Plugin Recommendations

Today a few Vagrant Plugin Recommendations.

Preconditions

Preparation

Create a simple Vagrant BaseBox (as here) and if you like use the following Vagrantfile.

1. vagrant-camera

2. vagrant-vbguest

3. vagrant-hostsupdater

 

Vagrant and YAML

Ruby`s stdlib provides an YAML module for data serialization. By using this module, we can create only one Vagrantfile which reads the configuration from YAML files. If you are thinking of build servers – so only YAML files are needed for generating complete environments.

Preconditions

Preparation

Usage

Deploy with Vagrant on KVM/libvirt

In this tutorial i show, how to extend Vagrant, to convert BaseBoxes and deploy to KVM/libvirt.

Preconditions

  • Vagrant installed (min. version 1.5)

Install Vagrant-Mutate and Vagrant-Libvirt

Convert existing VirtualBox BaseBox

Supported conversions by Vagrant-mutate

  • VirtualBox to KVM
  • VirtualBox to libvirt
  • libvirt to KVM
  • KVM to libvirt

Vagrantfile example

Note: Read the documentation, there are many settings more available!

Usage

Common Vagrant commands like: up, destroy, suspend, resume, halt, ssh etc are available.