-
Notifications
You must be signed in to change notification settings - Fork 19
/
main.tf
46 lines (41 loc) · 946 Bytes
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#
# This file is part of Cisco Modeling Labs
# Copyright (c) 2019-2024, Cisco Systems, Inc.
# All rights reserved.
#
locals {
raw_cfg = yamldecode(file(var.cfg_file))
cfg = merge(
{
for k, v in local.raw_cfg : k => v if k != "secret"
},
{
secrets = module.secrets.secrets
}
)
extras = var.cfg_extra_vars == null ? "" : (
fileexists(var.cfg_extra_vars) ? file(var.cfg_extra_vars) : var.cfg_extra_vars
)
}
module "secrets" {
source = "./modules/secrets"
cfg = local.raw_cfg
}
module "deploy" {
source = "./modules/deploy"
cfg = local.cfg
extras = local.extras
}
provider "cml2" {
address = "https://${module.deploy.public_ip}"
username = local.cfg.secrets.app.username
password = local.cfg.secrets.app.secret
skip_verify = true
dynamic_config = true
}
module "ready" {
source = "./modules/readyness"
depends_on = [
module.deploy.public_ip
]
}