From 031c011bf62026adbe8585cef7a694c765de3b5b Mon Sep 17 00:00:00 2001 From: "francesco.mangiacrapa" Date: Thu, 23 Nov 2023 16:57:00 +0100 Subject: [PATCH] Added geoserver configured by terraform --- .../d4s-dev/geoserver/.terraform.lock.hcl | 24 +++++ openstack-tf/d4s-dev/geoserver/geoserver.tf | 1 + openstack-tf/d4s-dev/geoserver/geoserver.zip | Bin 0 -> 8687 bytes openstack-tf/d4s-dev/geoserver/main.tf | 18 ++++ openstack-tf/d4s-dev/geoserver/provider.tf | 3 + .../d4s-dev/geoserver/variables-dev.tf | 1 + .../d4s-dev/geoserver/variables-geoserver.tf | 1 + openstack-tf/d4s-dev/geoserver/variables.tf | 1 + .../modules/common_variables/variables.tf | 102 +++++++++--------- openstack-tf/modules/geoserver/geoserver.tf | 38 +++++++ .../modules/geoserver/variables-geoserver.tf | 17 +++ 11 files changed, 155 insertions(+), 51 deletions(-) create mode 100644 openstack-tf/d4s-dev/geoserver/.terraform.lock.hcl create mode 120000 openstack-tf/d4s-dev/geoserver/geoserver.tf create mode 100644 openstack-tf/d4s-dev/geoserver/geoserver.zip create mode 100644 openstack-tf/d4s-dev/geoserver/main.tf create mode 100644 openstack-tf/d4s-dev/geoserver/provider.tf create mode 120000 openstack-tf/d4s-dev/geoserver/variables-dev.tf create mode 120000 openstack-tf/d4s-dev/geoserver/variables-geoserver.tf create mode 120000 openstack-tf/d4s-dev/geoserver/variables.tf create mode 100644 openstack-tf/modules/geoserver/geoserver.tf create mode 100644 openstack-tf/modules/geoserver/variables-geoserver.tf diff --git a/openstack-tf/d4s-dev/geoserver/.terraform.lock.hcl b/openstack-tf/d4s-dev/geoserver/.terraform.lock.hcl new file mode 100644 index 0000000..95c8b6a --- /dev/null +++ b/openstack-tf/d4s-dev/geoserver/.terraform.lock.hcl @@ -0,0 +1,24 @@ +# This file is maintained automatically by "terraform init". +# Manual edits may be lost in future updates. + +provider "registry.terraform.io/terraform-provider-openstack/openstack" { + version = "1.53.0" + constraints = "~> 1.53.0" + hashes = [ + "h1:YLGvYkSuagyP5orUTyKNK+JhzS17EFTUDpZ5R5/fFv4=", + "zh:09da7ca98ffd3de7b9ce36c4c13446212a6e763ba1162be71b50f95d453cb68e", + "zh:14041bcbb87312411d88612056ed185650bfd01284b8ea0761ce8105a331708e", + "zh:35bf4c788fdbc17c8e40ebc7b33c7de4b45a2fa2efaa657b10f0e3bd37c9627f", + "zh:46ede8ef4cfa12d654c538afc1e1ec34a1f3e8eb4e986ee23dceae398b7176a6", + "zh:59675734990dab1e8d87997853ea75e8104bba730b3f5a7146ac735540c9d6bf", + "zh:6de52428849806498670e827b54810be7510a2a79449602c1aede4235a0ec036", + "zh:78b2a20601272afceffac8f8ca78a6b647b84196c0dd8dc710fae297f6be15a4", + "zh:7c41ed3a4fac09677e676ecf9f9edd1e38eef449e656cb01a848d2c799c6de8f", + "zh:852800228f4118a4aa6cfaa4468b851247cbed6f037fd204f08de69eb1edc149", + "zh:86d618e7f9a07d978b8bc4b190be350a00de64ec535f9c8f5dfe133542a55483", + "zh:963a9e72b66d8bcf43de9b14a674ae3ca3719ce2f829217f7a65b66fc3773397", + "zh:a8e72ab67795071bda61f99a6de3d2d40122fb51971768fd75e1324abe874ced", + "zh:ce1890cf3af17d569af3bc7673cec0a8f78e6f5d701767593f3d29c551f44848", + "zh:e6f1b96eb684f527a47f71923f268c86a36d7894751b31ee9e726d7502a639cd", + ] +} diff --git a/openstack-tf/d4s-dev/geoserver/geoserver.tf b/openstack-tf/d4s-dev/geoserver/geoserver.tf new file mode 120000 index 0000000..e934684 --- /dev/null +++ b/openstack-tf/d4s-dev/geoserver/geoserver.tf @@ -0,0 +1 @@ +../../modules/geoserver/geoserver.tf \ No newline at end of file diff --git a/openstack-tf/d4s-dev/geoserver/geoserver.zip b/openstack-tf/d4s-dev/geoserver/geoserver.zip new file mode 100644 index 0000000000000000000000000000000000000000..8b6690f11722a1da62678af864936559c8898c01 GIT binary patch literal 8687 zcmb7JWl&t(vK|N$Ttd(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8eXt^-T6--1O5< z{sr;B44?jl`&FC&4!8L*<#jOr3HM(c|DSNbs@flo?5DBd{0{f0y#EvFS9$tF1^+aO zr@tfpH%@ n_`mVdpHBW-2fyzJ4-w!WX$B+*kMQH4Q63(yhf2yO{;~QW+oemh literal 0 HcmV?d00001 diff --git a/openstack-tf/d4s-dev/geoserver/main.tf b/openstack-tf/d4s-dev/geoserver/main.tf new file mode 100644 index 0000000..e3df3d8 --- /dev/null +++ b/openstack-tf/d4s-dev/geoserver/main.tf @@ -0,0 +1,18 @@ +# 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" + } +} diff --git a/openstack-tf/d4s-dev/geoserver/provider.tf b/openstack-tf/d4s-dev/geoserver/provider.tf new file mode 100644 index 0000000..fa7a121 --- /dev/null +++ b/openstack-tf/d4s-dev/geoserver/provider.tf @@ -0,0 +1,3 @@ +provider "openstack" { + cloud = "d4s-dev" +} diff --git a/openstack-tf/d4s-dev/geoserver/variables-dev.tf b/openstack-tf/d4s-dev/geoserver/variables-dev.tf new file mode 120000 index 0000000..fde4869 --- /dev/null +++ b/openstack-tf/d4s-dev/geoserver/variables-dev.tf @@ -0,0 +1 @@ +../variables/variables-dev.tf \ No newline at end of file diff --git a/openstack-tf/d4s-dev/geoserver/variables-geoserver.tf b/openstack-tf/d4s-dev/geoserver/variables-geoserver.tf new file mode 120000 index 0000000..36ea770 --- /dev/null +++ b/openstack-tf/d4s-dev/geoserver/variables-geoserver.tf @@ -0,0 +1 @@ +../../modules/geoserver/variables-geoserver.tf \ No newline at end of file diff --git a/openstack-tf/d4s-dev/geoserver/variables.tf b/openstack-tf/d4s-dev/geoserver/variables.tf new file mode 120000 index 0000000..be9f787 --- /dev/null +++ b/openstack-tf/d4s-dev/geoserver/variables.tf @@ -0,0 +1 @@ +../../modules/common_variables/variables.tf \ No newline at end of file diff --git a/openstack-tf/modules/common_variables/variables.tf b/openstack-tf/modules/common_variables/variables.tf index 011f40f..2ed0fcd 100644 --- a/openstack-tf/modules/common_variables/variables.tf +++ b/openstack-tf/modules/common_variables/variables.tf @@ -1,15 +1,15 @@ # Global definitions variable "main_region" { - type = string + type = string default = "isti_area_pi_1" } variable "external_network" { - type = map(string) + type = map(string) default = { name = "external-network" - id = "1d2ff137-6ff7-4017-be2b-0d6c4af2353b" - } + id = "1d2ff137-6ff7-4017-be2b-0d6c4af2353b" + } } variable "floating_ip_pools" { @@ -25,14 +25,14 @@ variable "resolvers_ip" { } variable "mtu_size" { - type = number + type = number default = 8942 } variable "availability_zones_names" { type = map(string) default = { - availability_zone_no_gpu = "cnr-isti-nova-a" + availability_zone_no_gpu = "cnr-isti-nova-a" availability_zone_with_gpu = "cnr-isti-nova-gpu-a" } } @@ -40,11 +40,11 @@ variable "availability_zones_names" { variable "ssh_sources" { type = map(string) default = { - s2i2s_vpn_1_cidr = "146.48.28.10/32" - s2i2s_vpn_2_cidr = "146.48.28.11/32" - d4s_vpn_1_cidr = "146.48.122.27/32" - d4s_vpn_2_cidr = "146.48.122.49/32" - shell_d4s_cidr = "146.48.122.95/32" + s2i2s_vpn_1_cidr = "146.48.28.10/32" + s2i2s_vpn_2_cidr = "146.48.28.11/32" + d4s_vpn_1_cidr = "146.48.122.27/32" + d4s_vpn_2_cidr = "146.48.122.49/32" + shell_d4s_cidr = "146.48.122.95/32" infrascience_net_cidr = "146.48.122.0/23" } } @@ -52,21 +52,21 @@ variable "ssh_sources" { variable "networks_with_d4s_services" { type = map(string) default = { - "isti_net" = "146.48.80.0/21" - "s2i2s_net" = "146.48.28.0/22" + "isti_net" = "146.48.80.0/21" + "s2i2s_net" = "146.48.28.0/22" "infrascience_net" = "146.48.122.0/23" - "garr_ct1_net" = "90.147.166.0/23" - "garr_pa1_net" = "90.147.188.0/23" - "garr_na_net" = "90.147.152.0/24" + "garr_ct1_net" = "90.147.166.0/23" + "garr_pa1_net" = "90.147.188.0/23" + "garr_na_net" = "90.147.152.0/24" } } variable "ssh_key_file" { type = map(string) default = { - file = "~/.ssh/id_ed25519" - name = "adellam" - } + file = "~/.ssh/privateKeySsh" + name = "francescomangiacrapa" + } } variable "ubuntu_1804" { @@ -75,7 +75,7 @@ variable "ubuntu_1804" { default = { name = "Ubuntu-Bionic-18.04" uuid = "7ed6a2cd-2b07-482e-8ce4-f018dff16c89" - } + } } variable "ubuntu_2204" { @@ -83,7 +83,7 @@ variable "ubuntu_2204" { default = { name = "Ubuntu-Jammy-22.04" uuid = "54768889-8556-4be4-a2eb-82a4d9b34627" - } + } } variable "centos_7" { @@ -91,7 +91,7 @@ variable "centos_7" { default = { name = "CentOS-7" uuid = "f0187a99-64f6-462a-ab5f-ef52fe62f2ca" - } + } } variable "almalinux_9" { @@ -99,7 +99,7 @@ variable "almalinux_9" { default = { name = "AlmaLinux-9.0-20220718" uuid = "541650fc-dd19-4f38-bb1d-7333ed9dd688" - } + } } variable "ubuntu1804_data_file" { @@ -117,61 +117,61 @@ variable "el7_data_file" { variable "ssh_jump_proxy" { type = map(string) default = { - name = "ssh-jump-proxy" + name = "ssh-jump-proxy" flavor = "m2.small" - } + } } variable "internal_ca_data" { type = map(string) default = { - name ="ca" + name = "ca" flavor = "m1.small" - } + } } variable "prometheus_server_data" { type = map(string) default = { - name ="prometheus" - flavor = "m1.medium" - vol_data_name = "prometheus-data" - vol_data_size = "100" - vol_data_device = "/dev/vdb" + name = "prometheus" + flavor = "m1.medium" + vol_data_name = "prometheus-data" + vol_data_size = "100" + vol_data_device = "/dev/vdb" public_grafana_server_cidr = "146.48.122.132/32" - } + } } variable "shared_postgresql_server_data" { type = map(string) default = { - name ="shared-postgresql-server" - flavor = "m1.medium" - vol_data_name = "shared-postgresql-data" - vol_data_size = "100" + name = "shared-postgresql-server" + flavor = "m1.medium" + vol_data_name = "shared-postgresql-data" + vol_data_size = "100" vol_data_device = "/dev/vdb" -# vol_backup_name = "" -# vol_backup_size = "" -# vol_backup_device = "" - network_name = "postgresql-srv-net" - network_description = "Network used to communicate with the shared postgresql service" - network_cidr = "192.168.0.0/22" + # vol_backup_name = "" + # vol_backup_size = "" + # vol_backup_device = "" + network_name = "postgresql-srv-net" + network_description = "Network used to communicate with the shared postgresql service" + network_cidr = "192.168.0.0/22" allocation_pool_start = "192.168.0.100" - allocation_pool_end = "192.168.3.254" - server_ip = "192.168.0.5" - server_cidr = "192.168.0.5/22" - } + allocation_pool_end = "192.168.3.254" + server_ip = "192.168.0.5" + server_cidr = "192.168.0.5/22" + } } variable "haproxy_l7_data" { type = map(string) default = { - name = "main-haproxy-l7" + name = "main-haproxy-l7" haproxy_1 = "haproxy-l7-1" haproxy_2 = "haproxy-l7-2" - flavor = "m1.medium" - vm_count = "2" - } + flavor = "m1.medium" + vm_count = "2" + } } variable "resource_registry_addresses" { diff --git a/openstack-tf/modules/geoserver/geoserver.tf b/openstack-tf/modules/geoserver/geoserver.tf new file mode 100644 index 0000000..5fd8369 --- /dev/null +++ b/openstack-tf/modules/geoserver/geoserver.tf @@ -0,0 +1,38 @@ +#Geoserver attached volume - used for 'geoserver_data' +resource "openstack_blockstorage_volume_v3" "geoserver_data_vol" { + name = var.geoserver_basic_data.vol_data_name + size = var.geoserver_basic_data.vol_data_size +} + +# Geoserver instance +resource "openstack_compute_instance_v2" "geoserver" { + name = var.geoserver_basic.name + availability_zone_hints = var.availability_zones_names.availability_zone_no_gpu + flavor_name = var.geoserver_basic.flavor + key_pair = var.ssh_key_file.name + security_groups = [var.default_security_group_name] + block_device { + uuid = var.ubuntu_1804.uuid + source_type = "image" + volume_size = 10 + boot_index = 0 + destination_type = "volume" + delete_on_termination = false + } + network { + name = var.main_private_network.name + } + network { + name = var.shared_postgresql_server_data.network_name + } + user_data = file("${var.ubuntu1804_data_file}") +} + + +# Attach the additional volume +resource "openstack_compute_volume_attach_v2" "geoserver_data_attach_vol" { + instance_id = openstack_compute_instance_v2.geoserver.id + volume_id = openstack_blockstorage_volume_v3.geoserver_data_vol.id + device = var.geoserver_basic_data.vol_data_device + depends_on = [openstack_compute_instance_v2.geoserver] +} diff --git a/openstack-tf/modules/geoserver/variables-geoserver.tf b/openstack-tf/modules/geoserver/variables-geoserver.tf new file mode 100644 index 0000000..a685d92 --- /dev/null +++ b/openstack-tf/modules/geoserver/variables-geoserver.tf @@ -0,0 +1,17 @@ +variable "geoserver_basic" { + type = map(string) + default = { + name = "geoserver" + description = "Geoserver instance" + flavor = "c1.medium" + } +} + +variable "geoserver_basic_data" { + type = map(string) + default = { + vol_data_name = "geoserver_data_volume" + vol_data_size = "20" + vol_data_device = "/dev/vdb" + } +}