Local Nomad Cluster Using Vagrant

Hi,

I’m looking for resources on setting up a local, stateful Nomad cluster for development, using Vagrant. The Nomad tutorial introduces tooling to create a stateless -dev cluster. I’d like to expand this to a stateful cluster that uses Vault and Consul as well. Any tips would be appreciated.

Thanks,
Manoj

Hey Manoj,

I set this up locally via Ansible + custom playbooks for each service, which extend the ansible-community Consul, Vault, and Nomad roles.

Depending on your configuration, you might be able to get away with a fully provisioned cluster at the time of your vagrant up call.

1 Like

Hi @egmanoj :wave:

Have you tried HashiQube?

It’s a community project that will spin-up a VM with several of the HashiCorp tools running. Give it a try and see if it fits what you need :slightly_smiling_face:

1 Like

I haven’t. And it looks very interesting. Will take it for a spin. Thanks!

1 Like

Nice! Let us know how it goes :grinning_face_with_smiling_eyes:

Tried another approach first. Rationale: want to use the same tools - as much as possible - for local, QA, staging, prod. With that in mind tried my hand at writing a Terraform script to provision a local Virtualbox cluster. I was hoping to reuse (more or less) the same TF script for QA (AWS), and Prod (AWS/GCP/Azure/Custom).

There is a Terraform plugin for Virtualbox, but it appears to be flaky. I was not able to get past terraform apply. Two boxes got created, but apply itself failed after running for ~11 minutes.

virtualbox_vm.node[0]: Still creating... [11m40s elapsed]
╷
│ Error: [ERROR] Starting VM: exit status 1
│ 
│   with virtualbox_vm.node[1],
│   on main.tf line 15, in resource "virtualbox_vm" "node":
│   15: resource "virtualbox_vm" "node" {
│ 
╵
╷
│ Error: [ERROR] Starting VM: exit status 1
│ 
│   with virtualbox_vm.node[0],
│   on main.tf line 15, in resource "virtualbox_vm" "node":
│   15: resource "virtualbox_vm" "node" {
│ 

I think I’ll put TF for local aside for now and look closely at HashiQube. I’d prefer a ‘simpler’ cluster than what HQ builds by default - only Nomad, Consul, and Vault installed. TF can wait until I’m ready to build QA+ clusters.

Update: I’ve been working with ansible-consul and ran into a problem.

@momer Are you at liberty to share your custom playbooks? If so, could you share them/snippets?