|
@@ -105,12 +105,12 @@ resource "null_resource" "raft_group_setup" {
|
|
|
|
|
|
resource "local_file" "inventory" {
|
|
resource "local_file" "inventory" {
|
|
content = templatefile("${path.module}/inventories/inventory.ctmpl",
|
|
content = templatefile("${path.module}/inventories/inventory.ctmpl",
|
|
- {
|
|
|
|
- nodes = module.nodes.node-ips
|
|
|
|
- tester = aws_eip.re-eip.public_ip
|
|
|
|
- path = abspath(path.module)
|
|
|
|
- }
|
|
|
|
- )
|
|
|
|
|
|
+ {
|
|
|
|
+ nodes = module.nodes.node-ips
|
|
|
|
+ tester = aws_eip.re-eip.public_ip
|
|
|
|
+ path = abspath(path.module)
|
|
|
|
+ }
|
|
|
|
+ )
|
|
filename = "${path.module}/inventories/inventory.ini"
|
|
filename = "${path.module}/inventories/inventory.ini"
|
|
file_permission = "0644"
|
|
file_permission = "0644"
|
|
}
|
|
}
|
|
@@ -118,11 +118,11 @@ resource "local_file" "inventory" {
|
|
|
|
|
|
resource "local_file" "ssh_config" {
|
|
resource "local_file" "ssh_config" {
|
|
content = templatefile("${path.module}/inventories/ssh.ctmpl",
|
|
content = templatefile("${path.module}/inventories/ssh.ctmpl",
|
|
- {
|
|
|
|
- ssh-key = "${var.vpc-name}.pem"
|
|
|
|
- ssh-user = "ubuntu"
|
|
|
|
- }
|
|
|
|
- )
|
|
|
|
|
|
+ {
|
|
|
|
+ ssh-key = "${var.vpc-name}.pem"
|
|
|
|
+ ssh-user = "ubuntu"
|
|
|
|
+ }
|
|
|
|
+ )
|
|
filename = "${path.module}/inventories/ssh.cfg"
|
|
filename = "${path.module}/inventories/ssh.cfg"
|
|
file_permission = "0644"
|
|
file_permission = "0644"
|
|
}
|
|
}
|
|
@@ -136,5 +136,9 @@ output "ansible1" {
|
|
}
|
|
}
|
|
|
|
|
|
output "ansible2" {
|
|
output "ansible2" {
|
|
- value = "Setup CP Redis Nodes\n\t\tansible-playbook -i inventories/inventory.ini ansible/nodes.yml"
|
|
|
|
-}
|
|
|
|
|
|
+ value = "Setup CP Redis Nodes\n\t\tansible-playbook -i inventories/inventory.ini ansible/nodes.yml -e 'NODE_IPS=${join(",", module.nodes.node-internal-ips)}'"
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+output "cpredisnodes" {
|
|
|
|
+ value = module.nodes.node-internal-ips
|
|
|
|
+}
|