Coder Social home page Coder Social logo

ansible-consul-cluster's Introduction

ansible-consul-cluster

The purpose of this repo is to provision out a 3-node Consul cluster. The inspiration behind this repo was a ready to roll Consul backend for Terraform.

Assumptions

The following list of assumptions are made but may be adjusted as neccessary.

  1. Functional vSphere environment including vCenter.
  2. Ubuntu (preferred) VM template available in vCenter.
  3. DHCP is available to assign IP addresses to VMs when they spin up.

NOTE: If you need an easy way to provision vSphere templates checkout my repo Packer-For-vSphere-and-More.

Requirements

Create group_vars/all/accounts.yml with the following contents (adapt to your environment):

---
# Defines Linux SSH password
ansible_password: packer

# Defines Linux SSH user
ansible_user: packer

# Defines vCenter password
vcenter_password: VMw@re1!

# Defines vCenter username
vcenter_username: [email protected]

NOTE: The above file is excluded from version control to ensure that account info is not leaked. You can also use ansible-vault if needed but you will need to remove accounts.yml from .gitignore.

Usage

Spinning Up VMs

Updating Variables

You will first need to spin up 3 VMs for the Consul cluster. These VMs are to be provisioned in a vSphere environment.

Modify the following to meet your environment requirements:

  1. group_vars/all/vms.yml
  2. group_vars/all/dns.yml
  3. group_vars/all/vcenter.yml

You also will need to adjust the following for Consul.

group_vars/consul_cluster/consul.yml:

# Generated using 'uuidgen'
# make sure to generate a new token and replace this one
consul_acl_master_token: 7A993C85-1EA6-412D-85DB-DA14EFCD03AB

# Generate using 'consul keygen'
# make sure to generate a new key and replace this
# also update key if you changed the it in your cluster via 'consul keyring',
# otherwise the role may deploy an outdated key to additional nodes which then
# can't join the cluster
consul_encryption_key: OJVXXkKdwifyqc9BrDe1VQ==

Spinning Up and Provisioning

To spin up the VMs:

provision_vms.yml:

ansible-playbook provisioned_vms.yml

After the VMs have been provisioned, hosts.inv will be populated to use as Ansible inventory.

To provision the VMs:

playbook.yml:

ansible-playbook -i hosts.inv playbook.yml

License

MIT

Author Information

Larry Smith Jr.

ansible-consul-cluster's People

Contributors

mrlesmithjr avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

joebibe

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.