Adds heimdall
Diff
main.tf | 7 +++++++
docker/outputs.tf | 4 ++++
heimdall/main.tf | 34 ++++++++++++++++++++++++++++++++++
heimdall/variables.tf | 11 +++++++++++
docker/conf/traefik.toml | 3 +++
5 files changed, 59 insertions(+)
@@ -49,6 +49,13 @@
traefik-labels = "${var.traefik-common-labels}"
}
module "heimdall" {
source = "heimdall"
domain = "bb8.fun"
traefik-labels = "${var.traefik-common-labels}"
auth-header = "${module.docker.auth-header}"
}
module "media" {
source = "media"
domain = "bb8.fun"
@@ -17,3 +17,7 @@
output "names-traefik" {
value = "${docker_container.traefik.name}"
}
output "auth-header" {
value = "${var.basic_auth}"
}
@@ -1,0 +1,34 @@
data "docker_registry_image" "heimdall" {
name = "linuxserver/heimdall:latest"
}
resource "docker_image" "heimdall" {
name = "${data.docker_registry_image.heimdall.name}"
pull_triggers = ["${data.docker_registry_image.heimdall.sha256_digest}"]
}
resource docker_container "heimdall" {
name = "heimdall"
image = "${docker_image.heimdall.latest}"
labels = "${merge(
var.traefik-labels, map(
"traefik.port", "443",
"traefik.protocol", "https",
"traefik.frontend.rule","Host:${var.domain}",
"traefik.frontend.auth.basic", "${var.auth-header}",
))}"
volumes {
host_path = "/mnt/xwing/config/heimdall"
container_path = "/config"
}
env = [
"TZ=Asia/Kolkata",
]
restart = "unless-stopped"
destroy_grace_seconds = 10
must_run = true
}
@@ -1,0 +1,11 @@
variable "domain" {
type = "string"
}
variable "auth-header" {
type = "string"
}
variable "traefik-labels" {
type = "map"
}
@@ -1,4 +1,7 @@
defaultEntryPoints = ["http", "https"]
InsecureSkipVerify = true
[entryPoints]
[entryPoints.http]
address = ":80"