Версии:
terraform version
Terraform v0.12.24
+ provider.openstack v1.26.0
Конфиг:
resource "openstack_compute_keypair_v2" "my-cloud-key" {
name = "apatsev-key"
public_key = file("/home/user/.ssh/id_rsa.pub")
}
resource "openstack_compute_instance_v2" "test" {
count = 3
name = "zookeper-${count.index}"
image_name = "CentOS_7.6_CloudImage_201901"
flavor_name = "c2.m8.d40"
key_pair = openstack_compute_keypair_v2.my-cloud-key.name
security_groups = ["any-any"]
network {
name = var.network
}
}
output "ip" {
value = "${openstack_compute_instance_v2.instance.network.0.fixed_ip_v4}"
}