brucellino.consul
Ansible Role for Consul
This is an Ansible role for installing Hashicorp Consul on compatible platforms, following the Datacenter deploy guide.
The role sets up a basic image that gets the Consul security materials (like the gossip key and CA) from a secure storage in a Vault instance.
With this role, you can set up images for both server and agent setups, then use these images to start instances that will create and connect nodes in the cluster.
Features
The role sets up:
- Consul in both agent and server modes
- Additional tools (
consul-template
,vault
) - Consul TLS and gossip secrets loaded from Vault
The role uses a Vault agent to create the Consul configuration files.
It also has experimental support for connecting to WiFi networks.
Requirements
You need a working Vault instance that contains TLS secrets and gossip keys in a specific location.
Machines will authenticate to Vault using an Approle Role ID.
This role can be used on virtual machines, physical machines, and Docker containers. Support for OCI containers will be added once a reliable detection method is identified.
Role Variables
For default variables, check defaults/main.yml
.
Dependencies
There are no dependencies on other roles.
Example Playbook
For an example playbook, see .github/build/playbook.yml
. An example Packer template to build the images is found in .github/build/consul.pkr.hcl
.
License
MIT
Author Information
@brucellino brucellino@proton.me
ansible-galaxy install brucellino.consul