-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconsul.tf
53 lines (45 loc) · 1.58 KB
/
consul.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
variable "os_auth_url" { }
variable "public_key_file" { }
variable "private_key_file" { }
variable "do_bootstrap" { }
variable "cluster_size" { }
variable "region" { }
variable "image_name" { }
variable "flavor_name" { }
variable "ssh_key_pair_name" { }
variable "security_group_ids" { type="list" }
variable "network_id" { }
variable "consul_version" { }
variable "env_name_prefix" { }
#####################################################################
module "consul" {
source = "./modules/consul"
public_key_file = "${ var.public_key_file }"
private_key_file = "${ var.private_key_file }"
os_auth_url = "${ var.os_auth_url }"
do_bootstrap = "${ var.do_bootstrap }"
cluster_size = "${ var.cluster_size }"
region = "${ var.region }"
image_name = "${ var.image_name }"
flavor_name = "${ var.flavor_name }"
ssh_key_pair_name = "${ var.ssh_key_pair_name }"
security_group_ids = "${ var.security_group_ids }"
network_id = "${ var.network_id }"
consul_version = "${ var.consul_version }"
env_name_prefix = "${ var.env_name_prefix }"
}
module "consul_client_config" {
source = "./modules/consul_client_config"
consul_version = "${ var.consul_version }"
data_dir = "/tmp/consul/data"
cluster_size = "${ var.cluster_size }"
server_ips = "${ module.consul.consul_endpoints }"
client_ip = "[INSERT CLIENT IP HERE]"
}
#####################################################################
output "consul_endpoints" {
value = [ "${ module.consul.consul_endpoints }" ]
}
output "consul_client_config" {
value = [ "${ module.consul_client_config.consul_client_config }" ]
}