37 lines
928 B
HCL
37 lines
928 B
HCL
# Define required providers
|
|
terraform {
|
|
required_version = ">= 0.14.0"
|
|
required_providers {
|
|
openstack = {
|
|
source = "terraform-provider-openstack/openstack"
|
|
version = "~> 1.53.0"
|
|
}
|
|
}
|
|
}
|
|
|
|
# Configure the OpenStack Provider
|
|
provider "openstack" {
|
|
cloud = "sto4-rut"
|
|
}
|
|
|
|
resource "openstack_compute_instance_v2" "worker-nodes" {
|
|
count = var.instance_count
|
|
name = "${var.worker_name}-${count.index}.${var.dns_suffix}"
|
|
flavor_id = "${var.instance_type}"
|
|
key_pair = "mifr-yubi"
|
|
security_groups = ["microk8s", "Allow SSH from SUNET jumphosts", "Allow ssh from the world"]
|
|
|
|
block_device {
|
|
uuid = "5d24aca9-11be-4de1-9770-4a097d68f361"
|
|
source_type = "image"
|
|
volume_size = 20
|
|
boot_index = 0
|
|
destination_type = "volume"
|
|
delete_on_termination = true
|
|
}
|
|
|
|
network {
|
|
name = "public"
|
|
}
|
|
}
|