Automated setup of consul cluster with below features.
This repo consists of Ansible role to setup consul cluster of:
- any number of agent server nodes
- any number of agent client nodes
Date | Version | Description | Changed By |
---|---|---|---|
1 June 2020 | v0.0.1 | Initial draft | Shatrujeet |
- Ubuntu:bionic
- Ubuntu:xenial
- Amazon AMI
- None
Values required to update and modify by users are kept here.
Variables | Default Values | Description |
---|---|---|
consul_binary_url | https://releases.hashicorp.com/consul/1.7.2/consul_1.7.2_linux_amd64.zip | Location to download consul binary |
consul_data_dir | /opt/consul | Data storage directory for consul |
datacenter | dc1 | Name of the datacenter |
raft_mul | 1 | Value of raft_mul |
Variables | Default Values | Description |
---|---|---|
consul_binary_dir | /usr/local/bin | Location to keep consul binary. Make sure this path is included in PATH environment variable |
consul_binary_perm | 0440 | Permission for consul binary |
consul_binary_owner | root | Owner of consul binary |
consul_binary_group | root | Group of consul binary |
consul_user_home | /etc/consul.d | Home directory for consul user |
consul_user_shell | /bin/false | Shell assigned to consul user |
consul_owner | consul | Consul data directory owner |
consul_group | consul | Consul data directory group |
consul_hcl_dest | /etc/consul.d/consul.hcl | Location to store consul configuration. Common for both server and client |
consul_hcl_mode | 0640 | Permission for consul.hcl file |
server_hcl_dest | /etc/consul.d/server.hcl | Location to store consul configuration. Only for server |
server_hcl_mode | 0640 | Permission for server.hcl file |
# consul.yml
---
- hosts: all
become: true
roles:
- role: osm_java
Your inventory should look like below.
[consul-leader]
server1 ansible_host=ip/dns ansible_connection=ssh ansible_user=ubuntu
[consul-server]
server2 ansible_host=ip/dns ansible_connection=ssh ansible_user=ubuntu
server3 ansible_host=ip/dns ansible_connection=ssh ansible_user=ubuntu
[consul-client]
client1 ansible_host=ip/dns ansible_connection=ssh ansible_user=ubuntu
ansible-playbook consul.yml
- support for CentOS
- TLS encryption for RPC protocol
- MIT / BSD
Shatrujeet