From a039557abb848d4fcd699f4d4e33ba4807159d08 Mon Sep 17 00:00:00 2001 From: genique Date: Fri, 6 Dec 2024 14:55:30 +0100 Subject: [PATCH] t --- environments/dev/main.tf | 8 ++++++-- modules/network/outputs.tf | 12 ++++++++++++ templates/ansible.cfg.tpl | 0 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 templates/ansible.cfg.tpl diff --git a/environments/dev/main.tf b/environments/dev/main.tf index e47f0cb..0384016 100644 --- a/environments/dev/main.tf +++ b/environments/dev/main.tf @@ -39,8 +39,12 @@ module "compute" { source = "../../modules/compute" # Variables d'entrée + instance-type = "e2-micro" + zone = "europe-west4-a" # Autres variables spécifiques au module - zone = var.zone - instance_type = var.instance_type + frontend_subnet_id = module.network.id_subnetwork["frontend"] + backend_subnet_id = module.network.id_subnetwork["backend"] + database_subnet_id = module.network.id_subnetwork["databse"] + } \ No newline at end of file diff --git a/modules/network/outputs.tf b/modules/network/outputs.tf index e69de29..cf7c773 100644 --- a/modules/network/outputs.tf +++ b/modules/network/outputs.tf @@ -0,0 +1,12 @@ +# Output d'un module +output "vpc_id" { + value = google_compute_network.vpc.id +} + +output "subnet_ids" { + value = { + frontend = google_compute_subnetwork.subnet_front.id, + backend = google_compute_subnetwork.subnet_back.id, + database = google_compute_subnetwork.subnet_db.id + } +} \ No newline at end of file diff --git a/templates/ansible.cfg.tpl b/templates/ansible.cfg.tpl new file mode 100644 index 0000000..e69de29