Skip to content

Commit 41eebec

Browse files
authored
Merge pull request #60 from remerge/CORE-506
Add support for SW RAID, standard data partition and private network
2 parents 70942f6 + 48bf1a7 commit 41eebec

File tree

2 files changed

+33
-9
lines changed

2 files changed

+33
-9
lines changed

leaseweb/server/installation/main.tf

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,29 +61,27 @@ MACAddress=${var.internal_mac}
6161
6262
[Network]
6363
Address=${var.internal_ip}/16
64-
Gateway=10.32.0.1
65-
DNS=10.164.15.230
64+
Gateway=${var.internal_gateway}
65+
DNS=${var.internal_dns}
6666
EOR
6767
6868
systemctl disable NetworkManager
6969
systemctl enable systemd-networkd
7070
7171
cat > /etc/resolv.conf <<EOR
72-
nameserver 10.164.15.230
72+
nameserver ${var.internal_dns}
7373
EOR
7474
75-
sgdisk -n 4:0:0 -t 4:8300 -c 4:data /dev/sda
76-
7775
reboot
7876
EOT
7977

8078
raid {
81-
type = "HW"
79+
type = var.raid_type
8280
level = 1
8381
number_of_disks = 2
8482
}
8583

86-
device = "SATA_SAS"
84+
device = var.device
8785

8886
partition {
8987
mountpoint = "/boot"
@@ -97,15 +95,21 @@ EOT
9795
size = 20480
9896
}
9997

98+
partition {
99+
mountpoint = "/data"
100+
filesystem = "ext4"
101+
size = "*"
102+
}
103+
100104
timeouts {
101-
create = "30m"
105+
create = "60m"
102106
}
103107

104108
lifecycle {
109+
prevent_destroy = true
105110
ignore_changes = [
106111
password,
107112
post_install_script,
108113
]
109-
prevent_destroy = true
110114
}
111115
}

leaseweb/server/installation/variables.tf

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@ variable "hostname" {
66
type = string
77
}
88

9+
variable "raid_type" {
10+
type = string
11+
default = "HW"
12+
}
13+
14+
variable "device" {
15+
type = string
16+
default = "SATA_SAS"
17+
}
18+
919
variable "internal_mac" {
1020
type = string
1121
}
@@ -14,6 +24,16 @@ variable "internal_ip" {
1424
type = string
1525
}
1626

27+
variable "internal_gateway" {
28+
type = string
29+
default = "10.32.0.1"
30+
}
31+
32+
variable "internal_dns" {
33+
type = string
34+
default = "10.164.15.230"
35+
}
36+
1737
variable "enrollment_token" {
1838
type = string
1939
sensitive = true

0 commit comments

Comments
 (0)