Adds heimdall

This commit is contained in:
Nemo 2018-02-18 13:18:20 +05:30
parent 8bb05fec66
commit 8942b09ada
5 changed files with 59 additions and 0 deletions

View File

@ -1,4 +1,7 @@
defaultEntryPoints = ["http", "https"]
InsecureSkipVerify = true
[entryPoints]
[entryPoints.http]
address = ":80"

View File

@ -17,3 +17,7 @@ output "names-mariadb" {
output "names-traefik" {
value = "${docker_container.traefik.name}"
}
output "auth-header" {
value = "${var.basic_auth}"
}

34
heimdall/main.tf Normal file
View File

@ -0,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
}

11
heimdall/variables.tf Normal file
View File

@ -0,0 +1,11 @@
variable "domain" {
type = "string"
}
variable "auth-header" {
type = "string"
}
variable "traefik-labels" {
type = "map"
}

View File

@ -49,6 +49,13 @@ module "tt-rss" {
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"