add manila shares for 3 dataset of bluecloud beacon

This commit is contained in:
Antonio Calanducci 2024-07-03 11:31:27 +02:00
parent e28b7ed747
commit 92d648a782
4 changed files with 7569 additions and 0 deletions

View File

@ -0,0 +1,126 @@
# NFS shares required by Bluecloud beacon service
# Create a NFS share
resource "openstack_sharedfilesystem_share_v2" "beacon_emodnet_chemistry" {
name = "beacon_emodnet_chemistry"
description = "NFS share for the Bluecloud beacon_emodnet_chemistry data volume"
share_proto = "NFS"
size = 10
}
# Allow access to the NFS share to Swarm Managers and Workers
resource "openstack_sharedfilesystem_share_access_v2" "beacon_emodnet_chemistry_mgr_share_access" {
for_each = { for nfs_ip in data.terraform_remote_state.main_infrastructure.outputs.swarm_managers_nfs_ip_ports : join("", nfs_ip.all_fixed_ips) => nfs_ip }
share_id = openstack_sharedfilesystem_share_v2.beacon_emodnet_chemistry.id
access_type = "ip"
access_to = each.key
access_level = "rw"
}
resource "openstack_sharedfilesystem_share_access_v2" "beacon_emodnet_chemistry_workers_share_access" {
for_each = { for nfs_ip in data.terraform_remote_state.main_infrastructure.outputs.swarm_workers_nfs_ip_ports : join("", nfs_ip.all_fixed_ips) => nfs_ip }
share_id = openstack_sharedfilesystem_share_v2.beacon_emodnet_chemistry.id
access_type = "ip"
access_to = each.key
access_level = "rw"
}
output "beacon_emodnet_chemistry_nfs_data" {
value = openstack_sharedfilesystem_share_v2.beacon_emodnet_chemistry
}
output "beacon_emodnet_chemistry_nfs_data_mgr_acls" {
value = openstack_sharedfilesystem_share_access_v2.beacon_emodnet_chemistry_mgr_share_access
sensitive = true
}
output "beacon_emodnet_chemistry_nfs_data_workers_acls" {
value = openstack_sharedfilesystem_share_access_v2.beacon_emodnet_chemistry_workers_share_access
sensitive = true
}
# Create a NFS share for wod
resource "openstack_sharedfilesystem_share_v2" "beacon_wod_data" {
name = "beacon_wod_data"
description = "NFS share for the Bluecloud beacon_wod_data data volume"
share_proto = "NFS"
size = 10
}
# Allow access to the NFS share to Swarm Managers and Workers
resource "openstack_sharedfilesystem_share_access_v2" "beacon_wod_data_mgr_share_access" {
for_each = { for nfs_ip in data.terraform_remote_state.main_infrastructure.outputs.swarm_managers_nfs_ip_ports : join("", nfs_ip.all_fixed_ips) => nfs_ip }
share_id = openstack_sharedfilesystem_share_v2.beacon_wod_data.id
access_type = "ip"
access_to = each.key
access_level = "rw"
}
resource "openstack_sharedfilesystem_share_access_v2" "beacon_wod_data_workers_share_access" {
for_each = { for nfs_ip in data.terraform_remote_state.main_infrastructure.outputs.swarm_workers_nfs_ip_ports : join("", nfs_ip.all_fixed_ips) => nfs_ip }
share_id = openstack_sharedfilesystem_share_v2.beacon_wod_data.id
access_type = "ip"
access_to = each.key
access_level = "rw"
}
output "beacon_wod_data_nfs_data" {
value = openstack_sharedfilesystem_share_v2.beacon_wod_data
}
output "beacon_wod_data_nfs_data_mgr_acls" {
value = openstack_sharedfilesystem_share_access_v2.beacon_wod_data_mgr_share_access
sensitive = true
}
output "beacon_wod_data_nfs_data_workers_acls" {
value = openstack_sharedfilesystem_share_access_v2.beacon_wod_data_workers_share_access
sensitive = true
}
# Create a NFS share for BGC
resource "openstack_sharedfilesystem_share_v2" "beacon_bgc_data" {
name = "beacon_bgc_data"
description = "NFS share for the Bluecloud beacon_bgc_data data volume"
share_proto = "NFS"
size = 10
}
# Allow access to the NFS share to Swarm Managers and Workers
resource "openstack_sharedfilesystem_share_access_v2" "beacon_bgc_data_mgr_share_access" {
for_each = { for nfs_ip in data.terraform_remote_state.main_infrastructure.outputs.swarm_managers_nfs_ip_ports : join("", nfs_ip.all_fixed_ips) => nfs_ip }
share_id = openstack_sharedfilesystem_share_v2.beacon_bgc_data.id
access_type = "ip"
access_to = each.key
access_level = "rw"
}
resource "openstack_sharedfilesystem_share_access_v2" "beacon_bgc_data_workers_share_access" {
for_each = { for nfs_ip in data.terraform_remote_state.main_infrastructure.outputs.swarm_workers_nfs_ip_ports : join("", nfs_ip.all_fixed_ips) => nfs_ip }
share_id = openstack_sharedfilesystem_share_v2.beacon_bgc_data.id
access_type = "ip"
access_to = each.key
access_level = "rw"
}
output "beacon_bgc_data_nfs_data" {
value = openstack_sharedfilesystem_share_v2.beacon_bgc_data
}
output "beacon_bgc_data_nfs_data_mgr_acls" {
value = openstack_sharedfilesystem_share_access_v2.beacon_bgc_data_mgr_share_access
sensitive = true
}
output "beacon_bgc_data_nfs_data_workers_acls" {
value = openstack_sharedfilesystem_share_access_v2.beacon_bgc_data_workers_share_access
sensitive = true
}

View File

@ -0,0 +1,37 @@
# Define required providers
terraform {
required_version = ">= 0.14.0"
required_providers {
openstack = {
source = "terraform-provider-openstack/openstack"
version = ">= 1.53.0"
}
}
}
data "terraform_remote_state" "privnet_dns_router" {
backend = "local"
config = {
path = "../../project-setup/terraform.tfstate"
}
}
data "terraform_remote_state" "main_infrastructure" {
backend = "local"
config = {
path = "../../basic-infrastructure/terraform.tfstate"
}
}
# SSH settings
module "ssh_settings" {
source = "../../../modules/ssh-key-ref"
}
#
# Uses common_variables as module
#
module "common_variables" {
source = "../../../modules/common_variables"
}

View File

@ -0,0 +1,3 @@
provider "openstack" {
cloud = "d4s-production"
}