-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathmain.tf
31 lines (28 loc) · 1.24 KB
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
locals {
identity_service = [for entry in data.openstack_identity_auth_scope_v3.scope.service_catalog :
entry if entry.type == "identity"][0]
identity_endpoint = [for endpoint in local.identity_service.endpoints :
endpoint if(endpoint.interface == "public" && endpoint.region == openstack_identity_application_credential_v3.rke2_csi.region)][0]
manifests_b64 = base64gzip(templatefile("${path.root}/cloud-config.yaml.tpl", {
auth_url = local.identity_endpoint.url
region = local.identity_endpoint.region
project_id = openstack_identity_application_credential_v3.rke2_csi.project_id
app_id = openstack_identity_application_credential_v3.rke2_csi.id
app_secret = openstack_identity_application_credential_v3.rke2_csi.secret
}))
}
data "openstack_identity_auth_scope_v3" "scope" {
name = "auth_scope"
}
resource "openstack_identity_application_credential_v3" "rke2_csi" {
name = "${var.cluster_name}-csi-credentials"
}
module "controlplane" {
source = "remche/rke2/openstack"
cluster_name = var.cluster_name
write_kubeconfig = true
image_name = "ubuntu-20.04-focal-x86_64"
flavor_name = "genX1"
public_net_name = "dmz"
manifests_gzb64 = { "cinder-csi-plugin" : local.manifests_b64 }
}