I am looking to pass variables to a script on a new created aws_instance, but I'm not sure how. Here is what I have:
provisioner "file" {
source = "${path.module}/scripts/slave-provisioner.sh"
destination = "/tmp/slave-provisioner.sh"
}
provisioner "remote-exec" {
inline = [
"chmod +x /tmp/slave-provisioner.sh",
"sudo /tmp/slave-provisioner.sh ${split(",",var.zookeeper_ips_list)}"
]
}
I have verified that the zookeeper_ips_list has the correct list of IPs.
There error that I get via terraform apply is:
/tmp/terraform_939984059.sh: 5: /tmp/terraform_939984059.sh: 10.239.12.181: not found
So basically I want to create this machine and then kick of my provisioner script that gets passed a list of IPs so it can do it's configuration.
replace()
)? – ydaetskcoR