A Terraform module for creating a Consul cluster on OpenStack (neutron)
The Consul cluster will have cluster_size
number of instances with the ssh keypair
applied. Assumes security_group_ids
allow ports required by Consul (see https://www.consul.io/docs/agent/options.html#ports). Tested with CoreOS Container-Linux.
os_auth_url
- OpenStack API auth urlpublic_key_file
- Path to ssh public key fileprivate_key_file
- Path to ssh private key filedo_bootstrap
- 1 to bootstrap cluster or 0 to join to existing cluster - NOTE: this currently only works with value 1 due to issue 14548 (see hashicorp/terraform#14548)cluster_size
- Number of instances to start for clusterregion
- ID of the OpenStack Regionimage_name
- Name of the OpenStack Image for instancesflavor_name
- Name of the OpenStack Flavor for instancesssh_key_pair_name
- Name of ssh keypair to create in OpenStacksecurity_group_ids
- ID of OpenStack security groupnetwork_id
- ID of OpenStack networkenv_name_prefix
- A unique prefix to keep clusters separateconsul_version
- Version of Consul (tested with 0.8.5)
consul_endpoints
- List of IP addresses of Consul cluster instances
module "consul" {
source = "github.com/paulwelch/tf_os_etcd"
os_auth_url = "https://example.com:5000/v3"
public_key_file = "~/.ssh/id_rsa.pub"
private_key_file = "~/.ssh/id_rsa"
do_bootstrap = "1"
cluster_size = "3"
region = "myregion"
image_name = "Container-Linux"
flavor_name = "m1.medium"
ssh_key_pair_name = "dev-key"
security_group_ids = [ "12312312-1231-1231-1231-123123123123" ]
network_id = "12312312-1231-1231-1231-123123123123123"
env_name_prefix = "dev"
consul_version = "0.8.5"
}
Created and maintained by Paul Welch
MIT Licensed. See LICENSE for full details.