150 lines
3.9 KiB
Terraform
150 lines
3.9 KiB
Terraform
|
locals {
|
||
|
caddy_data_filesystem = {
|
||
|
device = "${local.data_device_path}-part1"
|
||
|
format = "ext4"
|
||
|
label = "caddy_data"
|
||
|
}
|
||
|
|
||
|
caddy_data_volume_file = {
|
||
|
path = "/etc/containers/systemd/caddy_data.volume"
|
||
|
user = {id = 0}
|
||
|
group = {id = 0}
|
||
|
mode = 420 # 0644
|
||
|
contents = {
|
||
|
source = format(
|
||
|
"data:text/plain;base64,%s",
|
||
|
base64encode(file("${path.module}/files/caddy/caddy_data.volume"))
|
||
|
)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
fcos_images_filesystem = {
|
||
|
device = "${local.data_device_path}-part4"
|
||
|
format = "ext4"
|
||
|
label = "fcos_images"
|
||
|
}
|
||
|
|
||
|
fcos_images_volume_file = {
|
||
|
path = "/etc/containers/systemd/fcos_images.volume"
|
||
|
user = {id = 0}
|
||
|
group = {id = 0}
|
||
|
mode = 420 # 0644
|
||
|
contents = {
|
||
|
source = format(
|
||
|
"data:text/plain;base64,%s",
|
||
|
base64encode(file("${path.module}/files/caddy/fcos_images.volume"))
|
||
|
)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
image_downloader_image_file = {
|
||
|
path = "/etc/containers/systemd/image_downloader.image"
|
||
|
user = {id = 0}
|
||
|
group = {id = 0}
|
||
|
mode = 420 # 0644
|
||
|
contents = {
|
||
|
source = format(
|
||
|
"data:text/plain;base64,%s",
|
||
|
base64encode(file("${path.module}/files/caddy/image_downloader.image"))
|
||
|
)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
image_downloader_container_file = {
|
||
|
path = "/etc/containers/systemd/image_downloader.container"
|
||
|
user = {id = 0}
|
||
|
group = {id = 0}
|
||
|
mode = 420 # 0644
|
||
|
contents = {
|
||
|
source = format(
|
||
|
"data:text/plain;base64,%s",
|
||
|
base64encode(file("${path.module}/files/caddy/image_downloader.container"))
|
||
|
)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
caddy_builddir_dir = {
|
||
|
path = "/root/caddy"
|
||
|
user = {id = 0}
|
||
|
group = {id = 0}
|
||
|
mode = 448 # 0700
|
||
|
}
|
||
|
|
||
|
caddyfile_file = {
|
||
|
path = "/root/caddy/Caddyfile"
|
||
|
user = {id = 0}
|
||
|
group = {id = 0}
|
||
|
mode = 384 # 0600
|
||
|
contents = {
|
||
|
source = format(
|
||
|
"data:text/plain;base64,%s",
|
||
|
base64encode(file("${path.module}/files/caddy/Caddyfile"))
|
||
|
)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
ipxe_script_file = {
|
||
|
path = "/root/caddy/ipxe.script"
|
||
|
user = {id = 0}
|
||
|
group = {id = 0}
|
||
|
mode = 384 # 0600
|
||
|
contents = {
|
||
|
source = format(
|
||
|
"data:text/plain;base64,%s",
|
||
|
base64encode(file("${path.module}/files/caddy/ipxe.script"))
|
||
|
)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
caddy_containerfile_file = {
|
||
|
path = "/root/caddy/Containerfile"
|
||
|
user = {id = 0}
|
||
|
group = {id = 0}
|
||
|
mode = 384 # 0600
|
||
|
contents = {
|
||
|
source = format(
|
||
|
"data:text/plain;base64,%s",
|
||
|
base64encode(file("${path.module}/files/caddy/caddy.Containerfile"))
|
||
|
)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
caddy_container_file = {
|
||
|
path = "/etc/containers/systemd/caddy.container"
|
||
|
user = {id = 0}
|
||
|
group = {id = 0}
|
||
|
mode = 420 # 0644
|
||
|
contents = {
|
||
|
source = format(
|
||
|
"data:text/plain;base64,%s",
|
||
|
base64encode(file("${path.module}/files/caddy/caddy.container"))
|
||
|
)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
caddy_filesystems = [
|
||
|
local.caddy_data_filesystem,
|
||
|
local.fcos_images_filesystem,
|
||
|
]
|
||
|
|
||
|
caddy_directories = [
|
||
|
local.caddy_builddir_dir,
|
||
|
]
|
||
|
|
||
|
caddy_files = [
|
||
|
local.caddy_data_volume_file,
|
||
|
local.fcos_images_volume_file,
|
||
|
local.image_downloader_image_file,
|
||
|
local.image_downloader_container_file,
|
||
|
local.caddyfile_file,
|
||
|
local.ipxe_script_file,
|
||
|
local.caddy_containerfile_file,
|
||
|
local.caddy_container_file,
|
||
|
]
|
||
|
|
||
|
caddy_systemd_units = [
|
||
|
]
|
||
|
}
|
||
|
|
||
|
|