I'm kind of stuck here, not sure exactly what is wrong can someone help me.
Problem: When running below resource in Openstack using terraform, the user "aditya" gets created intermittently. I need the user to be created every-time.
Not sure if it's error in code or problem of vm's.
resource "openstack_compute_instance_v2" "test-machine" {
region = "zxy"
availability_zone = "zcy"
name = "test-machine"
security_groups = []
user_data = templatefile("/some/path",{
admin_username = "aditya"})
connection {
host = someip
type = "ssh"
user = "aditya"
private_key = test_pem
timeout = "20m"
}
provisioner "remote-exec" {
inline = [
"/bin/bash -c \"while [ ! -f /tmp/done-user-data ]; do sleep 2; done\"",
]
}
}