This commit is contained in:
2024-12-06 16:12:47 +01:00
parent 2c7daea69f
commit 43491ed096
9 changed files with 48 additions and 15 deletions

View File

@@ -38,7 +38,23 @@ module "compute" {
}
module "iam" {
source = "../../modules/iam"
source = "../../modules/iam"
project_id = var.project_id
}
data "google_client_openid_userinfo" "me" {
}
resource "local_file" "ansible_config" {
content = templatefile("${path.module}/../../templates/ansible.cfg.tpl",
{
remote_user = data.google_client_openid_userinfo.me.email
}
)
filename = "../../ansible/ansible.cfg"
}
resource "local_file" "service_account" {
content = base64decode(module.iam.service_account_key)
filename = "../../ansible/service_account.json"
}

View File

@@ -1,39 +1,46 @@
#- project_name (string)
variable "project_name" {
description = "Nom du projet"
type = string
default = "newtp-443913"
default = "tp-1-docker"
}
#- project_id (string)
variable "project_id" {
description = "ID du projet"
type = string
default = "newtp-443913"
default = "tp-1-docker"
}
# - region (string)
variable "region" {
description = "Région du projet"
type = string
default = "europe-west4"
}
# - frontend_cidr (string)
variable "frontend_cidr" {
description = "cidr du frontend"
type = string
default = "10.0.1.0/24"
}
# - backend_cidr (string)
variable "backend_cidr" {
description = "cidr du backend"
type = string
default = "10.0.2.0/24"
}
# - database_cidr (string)
variable "database_cidr" {
description = "cidr du database"
type = string
default = "10.0.3.0/24"
}
# - ssh_source_ranges (string)
variable "ssh_source_ranges" {
description = "Accès à internet"
type = string