-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
74 lines (61 loc) · 2.18 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
terraform {
required_version = ">= 1.4.0"
}
variable "pool" {
description = "Slurm pool of compute nodes"
default = []
}
module "openstack" {
source = "git::https://github.com/ComputeCanada/magic_castle.git//openstack?ref=14.0.0-beta"
config_git_url = "https://github.com/ComputeCanada/puppet-magic_castle.git"
config_version = "14.0.0-beta"
cluster_name = "basics"
domain = "ace-net.training"
image = "Rocky-9.3-x64-2023-11"
instances = {
mgmt = { type = "p4-7.5gb", tags = ["puppet", "mgmt", "nfs"], count = 1 }
login = { type = "p4-7.5gb", tags = ["login", "public", "proxy"], count = 1 }
node = { type = "p2-3.75gb", tags = ["node"], count = 2 }
}
# var.pool is managed by Slurm through Terraform REST API.
# To let Slurm manage a type of nodes, add "pool" to its tag list.
# When using Terraform CLI, this parameter is ignored.
# Refer to Magic Castle Documentation - Enable Magic Castle Autoscaling
pool = var.pool
volumes = {
nfs = {
home = { size = 100 }
project = { size = 50 }
scratch = { size = 50 }
}
}
public_keys = ["ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILWHSMDMhlXIy+C7/Dw4b7dUgfZkE3AXnG8PDDkyY9Qm cgeroux@lunar"]
nb_users = 100
# Shared password, randomly chosen if blank
guest_passwd = ""
}
output "accounts" {
value = module.openstack.accounts
}
output "public_ip" {
value = module.openstack.public_ip
}
## Uncomment to register your domain name with CloudFlare
module "dns" {
source = "git::https://github.com/ComputeCanada/magic_castle.git//dns/cloudflare"
name = module.openstack.cluster_name
domain = module.openstack.domain
public_instances = module.openstack.public_instances
}
## Uncomment to register your domain name with Google Cloud
# module "dns" {
# source = "git::https://github.com/ComputeCanada/magic_castle.git//dns/gcloud"
# project = "your-project-id"
# zone_name = "you-zone-name"
# name = module.openstack.cluster_name
# domain = module.openstack.domain
# public_instances = module.openstack.public_instances
# }
output "hostnames" {
value = module.dns.hostnames
}