Skip to content

Commit 33984b8

Browse files
committedNov 3, 2024
init move to tf modules
1 parent 832be9f commit 33984b8

18 files changed

+217
-43
lines changed
 

‎terraform/provider.tf renamed to ‎terraform/main.tf

+35-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
terraform {
2-
required_providers {
3-
proxmox = {
4-
source = "bpg/proxmox"
5-
version = "0.66.3"
6-
}
7-
}
2+
required_version = ">= 1.0.0"
3+
84

9-
backend "s3" {
5+
backend "s3" {
106
bucket = "BigBuckets"
117
region = "us-ashburn-1"
128
key = "tf.tfstate"
@@ -24,6 +20,15 @@ terraform {
2420
}
2521
}
2622

23+
terraform {
24+
required_providers {
25+
proxmox = {
26+
source = "bpg/proxmox"
27+
version = "0.66.3"
28+
}
29+
}
30+
}
31+
2732
provider "proxmox" {
2833
endpoint = var.virtual_environment_endpoint
2934
password = var.ssh_password
@@ -46,3 +51,26 @@ provider "proxmox" {
4651
}
4752
}
4853
}
54+
55+
module "proxmox" {
56+
source = "./proxmox"
57+
58+
virtual_environment_endpoint = var.virtual_environment_endpoint
59+
virtual_environment_api = var.virtual_environment_api
60+
arrbuntu_ip_address = var.arrbuntu_ip_address
61+
vlan_gateway = var.vlan_gateway
62+
downloaders_ip_address = var.downloaders_ip_address
63+
ssh_password = var.ssh_password
64+
ssh_username = var.ssh_username
65+
prox_ip_address = var.prox_ip_address
66+
npm_ip_address = var.npm_ip_address
67+
init_username = var.init_username
68+
init_password = var.init_password
69+
kasm_ip = var.kasm_ip
70+
kasm_ssh_ip = var.kasm_ssh_ip
71+
ubu_ip_address = var.ubu_ip_address
72+
pve2_ip_address = var.pve2_ip_address
73+
s3_endpoint = var.s3_endpoint
74+
aws_secret_access_key = var.aws_secret_access_key
75+
aws_access_key_id = var.aws_access_key_id
76+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

‎terraform/proxmox/provider.tf

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
terraform {
2+
required_providers {
3+
proxmox = {
4+
source = "bpg/proxmox"
5+
version = "0.66.3"
6+
}
7+
}
8+
}
9+
10+
provider "proxmox" {
11+
endpoint = var.virtual_environment_endpoint
12+
password = var.ssh_password
13+
username = "root@pam"
14+
insecure = true
15+
16+
ssh {
17+
agent = true
18+
username = "root"
19+
password = var.ssh_password
20+
21+
node {
22+
name = "prox"
23+
address = var.prox_ip_address
24+
}
25+
26+
node {
27+
name = "pve2"
28+
address = var.pve2_ip_address
29+
}
30+
}
31+
}
File renamed without changes.
File renamed without changes.

‎terraform/proxmox/variables.tf

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# Define each required variable
2+
variable "arrbuntu_ip_address" {
3+
description = "IP address for Arrbuntu VM"
4+
type = string
5+
}
6+
7+
variable "init_username" {
8+
description = "Username for initial configuration"
9+
type = string
10+
}
11+
12+
variable "downloaders_ip_address" {
13+
description = "IP address for Downloaders VM"
14+
type = string
15+
}
16+
17+
variable "npm_ip_address" {
18+
description = "IP address for NPM VM"
19+
type = string
20+
}
21+
22+
variable "prox_ip_address" {
23+
description = "IP address for Proxmox server"
24+
type = string
25+
}
26+
27+
variable "kasm_ssh_ip" {
28+
description = "IP address for Kasm SSH"
29+
type = string
30+
}
31+
32+
variable "aws_secret_access_key" {
33+
description = "AWS Secret Access Key"
34+
type = string
35+
sensitive = true
36+
}
37+
38+
variable "vlan_gateway" {
39+
description = "Gateway IP for VLAN"
40+
type = string
41+
}
42+
43+
variable "virtual_environment_endpoint" {
44+
description = "Endpoint for virtual environment API"
45+
type = string
46+
}
47+
48+
variable "kasm_ip" {
49+
description = "IP address for Kasm"
50+
type = string
51+
}
52+
53+
variable "ssh_username" {
54+
description = "Username for SSH access"
55+
type = string
56+
}
57+
58+
variable "init_password" {
59+
description = "Password for initial configuration"
60+
type = string
61+
sensitive = true
62+
}
63+
64+
variable "aws_access_key_id" {
65+
description = "AWS Access Key ID"
66+
type = string
67+
}
68+
69+
variable "pve2_ip_address" {
70+
description = "IP address for PVE2 Proxmox server"
71+
type = string
72+
}
73+
74+
variable "s3_endpoint" {
75+
description = "Endpoint for S3 storage"
76+
type = string
77+
}
78+
79+
variable "ubu_ip_address" {
80+
description = "IP address for Ubu VM"
81+
type = string
82+
}
83+
84+
variable "virtual_environment_api" {
85+
description = "API endpoint for virtual environment"
86+
type = string
87+
}
88+
89+
variable "ssh_password" {
90+
description = "Password for SSH access"
91+
type = string
92+
sensitive = true
93+
}
File renamed without changes.

‎terraform/variables.tf

+58-36
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,93 @@
1-
variable "virtual_environment_endpoint" {
2-
type = string
3-
}
4-
5-
variable "virtual_environment_api" {
6-
type = string
7-
}
8-
1+
# Define each required variable
92
variable "arrbuntu_ip_address" {
10-
type = string
3+
description = "IP address for Arrbuntu VM"
4+
type = string
115
}
126

13-
variable "vlan_gateway" {
14-
type = string
7+
variable "init_username" {
8+
description = "Username for initial configuration"
9+
type = string
1510
}
1611

1712
variable "downloaders_ip_address" {
18-
type = string
13+
description = "IP address for Downloaders VM"
14+
type = string
1915
}
2016

21-
variable "ssh_password" {
22-
type = string
17+
variable "npm_ip_address" {
18+
description = "IP address for NPM VM"
19+
type = string
2320
}
2421

25-
variable "ssh_username" {
26-
type = string
22+
variable "prox_ip_address" {
23+
description = "IP address for Proxmox server"
24+
type = string
2725
}
2826

29-
variable "prox_ip_address" {
30-
type = string
27+
variable "kasm_ssh_ip" {
28+
description = "IP address for Kasm SSH"
29+
type = string
3130
}
3231

33-
variable "npm_ip_address" {
34-
type = string
32+
variable "aws_secret_access_key" {
33+
description = "AWS Secret Access Key"
34+
type = string
35+
sensitive = true
3536
}
3637

37-
variable "init_username" {
38-
type = string
38+
variable "vlan_gateway" {
39+
description = "Gateway IP for VLAN"
40+
type = string
3941
}
4042

41-
variable "init_password" {
42-
type = string
43+
variable "virtual_environment_endpoint" {
44+
description = "Endpoint for virtual environment API"
45+
type = string
4346
}
4447

4548
variable "kasm_ip" {
46-
type = string
49+
description = "IP address for Kasm"
50+
type = string
4751
}
4852

49-
variable "kasm_ssh_ip" {
50-
type = string
53+
variable "ssh_username" {
54+
description = "Username for SSH access"
55+
type = string
5156
}
5257

53-
variable "ubu_ip_address" {
54-
type = string
58+
variable "init_password" {
59+
description = "Password for initial configuration"
60+
type = string
61+
sensitive = true
62+
}
63+
64+
variable "aws_access_key_id" {
65+
description = "AWS Access Key ID"
66+
type = string
5567
}
5668

5769
variable "pve2_ip_address" {
58-
type = string
70+
description = "IP address for PVE2 Proxmox server"
71+
type = string
5972
}
6073

6174
variable "s3_endpoint" {
62-
type = string
75+
description = "Endpoint for S3 storage"
76+
type = string
6377
}
6478

65-
variable "aws_secret_access_key" {
66-
type = string
79+
variable "ubu_ip_address" {
80+
description = "IP address for Ubu VM"
81+
type = string
6782
}
6883

69-
variable "aws_access_key_id" {
70-
type = string
71-
}
84+
variable "virtual_environment_api" {
85+
description = "API endpoint for virtual environment"
86+
type = string
87+
}
88+
89+
variable "ssh_password" {
90+
description = "Password for SSH access"
91+
type = string
92+
sensitive = true
93+
}

0 commit comments

Comments
 (0)
Please sign in to comment.