Skip to content

Commit f75ec17

Browse files
committed
change image-file reference to null-resource using curl
Signed-off-by: Andre Licht <al@cloudeteer.de>
1 parent e0e5eec commit f75ec17

3 files changed

Lines changed: 18 additions & 4 deletions

File tree

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,4 @@ openrc
4949
key.json
5050

5151
# Ignore volume images stored locally
52-
*.qcow2
5352
*.raw

prod-stackit/terraform/50_projects/team-iac-test01/modules/firewall/main.tf

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,30 @@
1+
# Local copy of the Image
2+
resource "null_resource" "pfsense_image_file" {
3+
triggers = {
4+
always_run = timestamp()
5+
}
6+
7+
provisioner "local-exec" {
8+
command = "curl -o \"${path.module}/pfsense.qcow2\" https://pfsense.object.storage.eu01.onstackit.cloud/pfsense-ce-2.7.2-amd64-10-12-2024.qcow2"
9+
}
10+
lifecycle {
11+
ignore_changes = all
12+
}
13+
}
14+
115
resource "stackit_image" "this" {
216
project_id = var.project_id
317
labels = var.labels
418

5-
name = "pfsense-ce-2.7.2-amd64-10-12-2024_stackit_image"
619
disk_format = "qcow2"
7-
local_file_path = "${path.module}/pfsense-ce-2.7.2-amd64-10-12-2024.qcow2"
8-
20+
name = "pfsense-2.7.2-amd64-image"
21+
local_file_path = "${path.module}/pfsense.qcow2"
922
config = {
1023
# UEFI must be disabled for this image to boot correctly
1124
uefi = false
1225
}
26+
27+
depends_on = [null_resource.pfsense_image_file]
1328
}
1429

1530
resource "stackit_server" "this" {

prod-stackit/terraform/50_projects/team-iac-test01/modules/firewall/pfsense.qcow2

Whitespace-only changes.

0 commit comments

Comments
 (0)