-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.tf
60 lines (52 loc) · 1.62 KB
/
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
module "pre-init-schematics" {
source = "./modules/pre-init"
count = (var.PRIVATE_SSH_KEY == "n.a" && var.BASTION_FLOATING_IP == "localhost" ? 0 : 1)
ID_RSA_FILE_PATH = var.ID_RSA_FILE_PATH
PRIVATE_SSH_KEY = var.PRIVATE_SSH_KEY
}
module "pre-init-cli" {
source = "./modules/pre-init/cli"
count = (var.PRIVATE_SSH_KEY == "n.a" && var.BASTION_FLOATING_IP == "localhost" ? 1 : 0)
ID_RSA_FILE_PATH = var.ID_RSA_FILE_PATH
}
module "precheck-ssh-exec" {
source = "./modules/precheck-ssh-exec"
count = (var.PRIVATE_SSH_KEY == "n.a" && var.BASTION_FLOATING_IP == "localhost" ? 0 : 1)
depends_on = [ module.pre-init-schematics ]
BASTION_FLOATING_IP = var.BASTION_FLOATING_IP
ID_RSA_FILE_PATH = var.ID_RSA_FILE_PATH
PRIVATE_SSH_KEY = var.PRIVATE_SSH_KEY
HOSTNAME = var.HOSTNAME
SECURITY_GROUP = var.SECURITY_GROUP
}
module "vpc-subnet" {
source = "./modules/vpc/subnet"
depends_on = [ module.precheck-ssh-exec ]
ZONE = var.ZONE
VPC = var.VPC
SECURITY_GROUP = var.SECURITY_GROUP
SUBNET = var.SUBNET
}
module "volumes" {
source = "./modules/volumes"
depends_on = [ module.pre-init-schematics, module.pre-init-cli ]
ZONE = var.ZONE
HOSTNAME = var.HOSTNAME
RESOURCE_GROUP = var.RESOURCE_GROUP
SWAP = var.SWAP
VOL1 = var.VOL1
}
module "vsi" {
source = "./modules/vsi"
depends_on = [ module.volumes ]
ZONE = var.ZONE
VPC = var.VPC
SECURITY_GROUP = var.SECURITY_GROUP
RESOURCE_GROUP = var.RESOURCE_GROUP
SUBNET = var.SUBNET
HOSTNAME = var.HOSTNAME
PROFILE = var.PROFILE
IMAGE = var.IMAGE
SSH_KEYS = var.SSH_KEYS
VOLUMES_LIST = module.volumes.volumes_list
}