mirror of
https://github.com/luigieai/homelab.git
synced 2025-06-04 23:16:35 -03:00
deluge deployment
This commit is contained in:
parent
690b2b01c4
commit
4200d70105
5 changed files with 78 additions and 0 deletions
|
@ -12,3 +12,9 @@ module "freqtrade" {
|
||||||
username = var.username
|
username = var.username
|
||||||
password = var.password
|
password = var.password
|
||||||
}
|
}
|
||||||
|
module "deluge" {
|
||||||
|
source = "./modules/deluge"
|
||||||
|
providers = {
|
||||||
|
nomad = nomad
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
56
terraform-lab/modules/deluge/conf/deluge.hcl
Normal file
56
terraform-lab/modules/deluge/conf/deluge.hcl
Normal file
|
@ -0,0 +1,56 @@
|
||||||
|
job "deluge" {
|
||||||
|
datacenters = ["marioverde"]
|
||||||
|
type = "service"
|
||||||
|
|
||||||
|
group "deluge" {
|
||||||
|
count = 1
|
||||||
|
|
||||||
|
network {
|
||||||
|
port "http" { static = 8112 }
|
||||||
|
port "tcp1" { static = 58846 }
|
||||||
|
port "tcp2" { static = 58946 }
|
||||||
|
}
|
||||||
|
|
||||||
|
service {
|
||||||
|
port = "http"
|
||||||
|
name = "deluge"
|
||||||
|
provider = "nomad"
|
||||||
|
tags = [
|
||||||
|
"traefik.enable=true",
|
||||||
|
"traefik.http.routers.deluge_http.entrypoints=web,websecure",
|
||||||
|
"traefik.http.routers.deluge_http.rule=Host(`deluge.marioverde.com.br`)",
|
||||||
|
]
|
||||||
|
check {
|
||||||
|
type = "http"
|
||||||
|
path = "/"
|
||||||
|
interval = "10s"
|
||||||
|
timeout = "2s"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
task "deluge" {
|
||||||
|
driver = "podman"
|
||||||
|
|
||||||
|
config {
|
||||||
|
image = "docker.io/linuxserver/deluge:2.1.1"
|
||||||
|
network_mode = "host"
|
||||||
|
ports = ["http", "tcp1", "tcp2"]
|
||||||
|
privileged = "true"
|
||||||
|
volumes = [
|
||||||
|
"/etc/deluge:/config",
|
||||||
|
"/opt/media/deluge:/downloads",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
env {
|
||||||
|
PUID = "0"
|
||||||
|
PGID = "0"
|
||||||
|
}
|
||||||
|
|
||||||
|
resources {
|
||||||
|
cpu = 2000
|
||||||
|
memory = 2048
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
4
terraform-lab/modules/deluge/job.tf
Normal file
4
terraform-lab/modules/deluge/job.tf
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
resource "nomad_job" "app" {
|
||||||
|
jobspec = templatefile("${path.module}/conf/deluge.hcl", {})
|
||||||
|
|
||||||
|
}
|
9
terraform-lab/modules/deluge/providers.tf
Normal file
9
terraform-lab/modules/deluge/providers.tf
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
terraform {
|
||||||
|
required_providers {
|
||||||
|
nomad = {
|
||||||
|
source = "hashicorp/nomad"
|
||||||
|
version = "2.4.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
required_version = ">= 0.14"
|
||||||
|
}
|
|
@ -7,6 +7,9 @@ resource "nomad_job" "app" {
|
||||||
exchange_password = var.exchange_password,
|
exchange_password = var.exchange_password,
|
||||||
telegram_token = var.telegram_token,
|
telegram_token = var.telegram_token,
|
||||||
telegram_chat_id = var.telegram_chat_id
|
telegram_chat_id = var.telegram_chat_id
|
||||||
|
jwt_secret_key = var.jwt_secret_key
|
||||||
|
username = var.username
|
||||||
|
password = var.password
|
||||||
})
|
})
|
||||||
STRATEGY_NAME = file("${path.module}/conf/strategy.py")
|
STRATEGY_NAME = file("${path.module}/conf/strategy.py")
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Reference in a new issue