Fixed gcat terraform plan

This commit is contained in:
Luca Frosini 2023-12-05 12:12:07 +01:00
parent 6568938eac
commit 89b9165f58
2 changed files with 97 additions and 23 deletions

View File

@ -17,6 +17,22 @@ data "terraform_remote_state" "privnet_dns_router" {
} }
} }
#
# Uses common_variables as module
#
module "common_variables" {
source = "../../modules/common_variables"
}
#
# Creates the server group "uri-resolver"
#
resource "openstack_compute_servergroup_v2" "gcat_server_group" {
name = "gcat"
policies = [module.common_variables.policy_list.soft_anti_affinity]
}
module "smartgears_service_generic" { module "smartgears_service_generic" {
source = "../../modules/generic_smartgears_service" source = "../../modules/generic_smartgears_service"
@ -25,18 +41,20 @@ module "smartgears_service_generic" {
gcat_1 = { gcat_1 = {
name = "gcat-1", name = "gcat-1",
description = "This instance serves gcat service", description = "This instance serves gcat service",
flavor = "m1.medium", flavor = module.common_variables.flavor_list.m1_medium,
networks = ["d4s-dev-cloud-main"], networks = ["d4s-dev-cloud-main"],
security_groups = ["default", "http and https from the load balancers"] security_groups = [module.common_variables.security_group_list.default, module.common_variables.security_group_list.http_and_https_from_the_load_balancers],
block_device_uuid = "7ed6a2cd-2b07-482e-8ce4-f018dff16c89" #ubuntu_18_04.uuid of DEV server_groups_ids = [openstack_compute_servergroup_v2.gcat_server_group.id],
image_ref = module.common_variables.ubuntu_1804
}, },
gcat_2 = { gcat_2 = {
name = "gcat-2", name = "gcat-2",
description = "This instance serves gcat service", description = "This instance serves gcat service",
flavor = "m1.medium", flavor = module.common_variables.flavor_list.m1_medium,
networks = ["d4s-dev-cloud-main"], networks = ["d4s-dev-cloud-main"],
security_groups = ["default", "http and https from the load balancers"] security_groups = [module.common_variables.security_group_list.default, module.common_variables.security_group_list.http_and_https_from_the_load_balancers],
block_device_uuid = "7ed6a2cd-2b07-482e-8ce4-f018dff16c89" #ubuntu_18_04.uuid of DEV server_groups_ids = [openstack_compute_servergroup_v2.gcat_server_group.id],
image_ref = module.common_variables.ubuntu_1804
} }
} }
} }

View File

@ -1,7 +1,7 @@
{ {
"version": 4, "version": 4,
"terraform_version": "1.6.4", "terraform_version": "1.6.4",
"serial": 3, "serial": 9,
"lineage": "8a740e95-13ce-029b-b372-f1b423772e3f", "lineage": "8a740e95-13ce-029b-b372-f1b423772e3f",
"outputs": {}, "outputs": {},
"resources": [ "resources": [
@ -50,6 +50,34 @@
} }
] ]
}, },
{
"mode": "managed",
"type": "openstack_compute_servergroup_v2",
"name": "gcat_server_group",
"provider": "provider[\"registry.terraform.io/terraform-provider-openstack/openstack\"]",
"instances": [
{
"schema_version": 0,
"attributes": {
"id": "f580e6ef-93ec-4926-b7fb-6db6fc7160a5",
"members": [],
"name": "gcat",
"policies": [
"soft-anti-affinity"
],
"region": "isti_area_pi_1",
"rules": [
{
"max_server_per_host": 0
}
],
"value_specs": null
},
"sensitive_attributes": [],
"private": "bnVsbA=="
}
]
},
{ {
"module": "module.smartgears_service_generic", "module": "module.smartgears_service_generic",
"mode": "managed", "mode": "managed",
@ -61,7 +89,7 @@
"index_key": "gcat_1", "index_key": "gcat_1",
"schema_version": 0, "schema_version": 0,
"attributes": { "attributes": {
"access_ip_v4": "10.1.31.228", "access_ip_v4": "10.1.31.87",
"access_ip_v6": "", "access_ip_v6": "",
"admin_pass": null, "admin_pass": null,
"all_metadata": {}, "all_metadata": {},
@ -84,12 +112,12 @@
} }
], ],
"config_drive": null, "config_drive": null,
"created": "2023-12-04 16:02:03 +0000 UTC", "created": "2023-12-05 11:09:51 +0000 UTC",
"flavor_id": "4", "flavor_id": "4",
"flavor_name": "m1.medium", "flavor_name": "m1.medium",
"floating_ip": null, "floating_ip": null,
"force_delete": false, "force_delete": false,
"id": "b3b38ab3-3efa-4c38-a1f9-ffb616b6f6d9", "id": "d92bed2c-cca3-4681-8a40-d01a639ff6f3",
"image_id": "Attempt to boot from volume - no image supplied", "image_id": "Attempt to boot from volume - no image supplied",
"image_name": null, "image_name": null,
"key_pair": "pc-frosini_key", "key_pair": "pc-frosini_key",
@ -98,10 +126,10 @@
"network": [ "network": [
{ {
"access_network": false, "access_network": false,
"fixed_ip_v4": "10.1.31.228", "fixed_ip_v4": "10.1.31.87",
"fixed_ip_v6": "", "fixed_ip_v6": "",
"floating_ip": "", "floating_ip": "",
"mac": "fa:16:3e:bd:10:bd", "mac": "fa:16:3e:a1:e7:ee",
"name": "d4s-dev-cloud-main", "name": "d4s-dev-cloud-main",
"port": "", "port": "",
"uuid": "e0af5eba-f24a-4d0d-8184-bc654b980c4a" "uuid": "e0af5eba-f24a-4d0d-8184-bc654b980c4a"
@ -111,7 +139,18 @@
"personality": [], "personality": [],
"power_state": "active", "power_state": "active",
"region": "isti_area_pi_1", "region": "isti_area_pi_1",
"scheduler_hints": [], "scheduler_hints": [
{
"additional_properties": null,
"build_near_host_ip": "",
"different_cell": [],
"different_host": [],
"group": "f580e6ef-93ec-4926-b7fb-6db6fc7160a5",
"query": [],
"same_host": [],
"target_cell": ""
}
],
"security_groups": [ "security_groups": [
"default", "default",
"http and https from the load balancers" "http and https from the load balancers"
@ -119,19 +158,22 @@
"stop_before_destroy": false, "stop_before_destroy": false,
"tags": null, "tags": null,
"timeouts": null, "timeouts": null,
"updated": "2023-12-04 16:05:31 +0000 UTC", "updated": "2023-12-05 11:10:49 +0000 UTC",
"user_data": "47d4769e61324c305c4b70ed6673de4fad84150d", "user_data": "47d4769e61324c305c4b70ed6673de4fad84150d",
"vendor_options": [], "vendor_options": [],
"volume": [] "volume": []
}, },
"sensitive_attributes": [], "sensitive_attributes": [],
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxODAwMDAwMDAwMDAwLCJkZWxldGUiOjE4MDAwMDAwMDAwMDAsInVwZGF0ZSI6MTgwMDAwMDAwMDAwMH19" "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxODAwMDAwMDAwMDAwLCJkZWxldGUiOjE4MDAwMDAwMDAwMDAsInVwZGF0ZSI6MTgwMDAwMDAwMDAwMH19",
"dependencies": [
"openstack_compute_servergroup_v2.gcat_server_group"
]
}, },
{ {
"index_key": "gcat_2", "index_key": "gcat_2",
"schema_version": 0, "schema_version": 0,
"attributes": { "attributes": {
"access_ip_v4": "10.1.28.108", "access_ip_v4": "10.1.29.12",
"access_ip_v6": "", "access_ip_v6": "",
"admin_pass": null, "admin_pass": null,
"all_metadata": {}, "all_metadata": {},
@ -154,12 +196,12 @@
} }
], ],
"config_drive": null, "config_drive": null,
"created": "2023-12-04 16:02:03 +0000 UTC", "created": "2023-12-05 11:09:51 +0000 UTC",
"flavor_id": "4", "flavor_id": "4",
"flavor_name": "m1.medium", "flavor_name": "m1.medium",
"floating_ip": null, "floating_ip": null,
"force_delete": false, "force_delete": false,
"id": "0aa5726b-f6cc-4127-8216-34cdbc679b5f", "id": "3cdfe9a1-61c4-4c3e-8f8e-5af2fa2e6f3d",
"image_id": "Attempt to boot from volume - no image supplied", "image_id": "Attempt to boot from volume - no image supplied",
"image_name": null, "image_name": null,
"key_pair": "pc-frosini_key", "key_pair": "pc-frosini_key",
@ -168,10 +210,10 @@
"network": [ "network": [
{ {
"access_network": false, "access_network": false,
"fixed_ip_v4": "10.1.28.108", "fixed_ip_v4": "10.1.29.12",
"fixed_ip_v6": "", "fixed_ip_v6": "",
"floating_ip": "", "floating_ip": "",
"mac": "fa:16:3e:33:94:ce", "mac": "fa:16:3e:4e:14:19",
"name": "d4s-dev-cloud-main", "name": "d4s-dev-cloud-main",
"port": "", "port": "",
"uuid": "e0af5eba-f24a-4d0d-8184-bc654b980c4a" "uuid": "e0af5eba-f24a-4d0d-8184-bc654b980c4a"
@ -181,7 +223,18 @@
"personality": [], "personality": [],
"power_state": "active", "power_state": "active",
"region": "isti_area_pi_1", "region": "isti_area_pi_1",
"scheduler_hints": [], "scheduler_hints": [
{
"additional_properties": null,
"build_near_host_ip": "",
"different_cell": [],
"different_host": [],
"group": "f580e6ef-93ec-4926-b7fb-6db6fc7160a5",
"query": [],
"same_host": [],
"target_cell": ""
}
],
"security_groups": [ "security_groups": [
"default", "default",
"http and https from the load balancers" "http and https from the load balancers"
@ -189,13 +242,16 @@
"stop_before_destroy": false, "stop_before_destroy": false,
"tags": null, "tags": null,
"timeouts": null, "timeouts": null,
"updated": "2023-12-04 16:03:23 +0000 UTC", "updated": "2023-12-05 11:10:25 +0000 UTC",
"user_data": "47d4769e61324c305c4b70ed6673de4fad84150d", "user_data": "47d4769e61324c305c4b70ed6673de4fad84150d",
"vendor_options": [], "vendor_options": [],
"volume": [] "volume": []
}, },
"sensitive_attributes": [], "sensitive_attributes": [],
"private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxODAwMDAwMDAwMDAwLCJkZWxldGUiOjE4MDAwMDAwMDAwMDAsInVwZGF0ZSI6MTgwMDAwMDAwMDAwMH19" "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxODAwMDAwMDAwMDAwLCJkZWxldGUiOjE4MDAwMDAwMDAwMDAsInVwZGF0ZSI6MTgwMDAwMDAwMDAwMH19",
"dependencies": [
"openstack_compute_servergroup_v2.gcat_server_group"
]
} }
] ]
} }