data "external" "check_consul_bootstrap" {
program = ["ssh", "-o", "StrictHostKeyChecking=no", "root@${var.consul_servers.omni-consul-0["ip_address"]}", <<EOF
export CONSUL_CAPATH=/etc/consul.d/certs/ca.crt
export CONSUL_CLIENT_CERT=/etc/consul.d/certs/host.crt
export CONSUL_HTTP_SSL_VERIFY=true
while true; do if consul members &> /dev/null; then break; fi; sleep 2; done
token="dummy"
jq -n --arg token "$token" '{"token":$token}'
EOF
]
depends_on = [
# time_sleep.wait_15_seconds_consul,
vsphere_virtual_machine.consul_server,
]
}
I’m running this command on a virtual machine, which on the VM is translated into:
root 2158 2104 0 1940 3396 0 17:20 ? 00:00:00 bash -c ?export CONSUL_CAPATH=/etc/consul.d/certs/ca.crt ?export CONSUL_CLIENT_CERT=/etc/consul.d/certs/host.crt
?export CONSUL_HTTP_SSL_VERIFY=true ?while true; do if consul members &> /dev/null; then break; fi; sleep 2; done ?token="dummy" ?jq -n --arg token "$token" '{"token":$token}'
for some weird reason. before each line in the terraform config file there are also tabs. Any ideas why this is happening?
Changing the tabs to spaces and adding ;
after each command returns this:
bash -c export CONSUL_CAPATH=/etc/consul.d/certs/ca.crt; export CONSUL_CLIENT_CERT=/etc/consul.d/certs/host.crt; export CONSUL_HTTP_SSL_VERIFY=true; while true; do if consul members &> /dev/null; then break; fi; sleep 2; done; token="dummy"; jq -n --arg token "$token" '{"token":$token}';
Which still isn’t working.