forked from moguljak/tp-cloud
Ajout du module IAM
This commit is contained in:
@@ -35,4 +35,26 @@ module "compute" {
|
||||
frontend_subnet = module.network.subnet_id["frontend"]
|
||||
backend_subnet = module.network.subnet_id["backend"]
|
||||
database_subnet = module.network.subnet_id["database"]
|
||||
}
|
||||
|
||||
module "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"
|
||||
}
|
@@ -44,4 +44,10 @@ variable "zone" {
|
||||
description = "zone"
|
||||
type = string
|
||||
default = "europe-west4-b"
|
||||
}
|
||||
|
||||
variable "project_id" {
|
||||
description = "ID du projet GCP"
|
||||
type = string
|
||||
default = "projet-vertu"
|
||||
}
|
Reference in New Issue
Block a user