mirror of
https://github.com/luigieai/homelab.git
synced 2025-06-07 16:06:35 -03:00
infra: Icecast deployment
This commit is contained in:
parent
ae51769685
commit
5312262c3f
4 changed files with 69 additions and 0 deletions
|
@ -31,3 +31,11 @@ module "keycloak" {
|
||||||
nomad = nomad
|
nomad = nomad
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
module "icecast" {
|
||||||
|
source = "./modules/icecast"
|
||||||
|
|
||||||
|
providers = {
|
||||||
|
nomad = nomad
|
||||||
|
}
|
||||||
|
}
|
46
terraform/modules/icecast/conf/icecast.hcl
Normal file
46
terraform/modules/icecast/conf/icecast.hcl
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
job "icecast" {
|
||||||
|
datacenters = ["dc"]
|
||||||
|
type = "service"
|
||||||
|
|
||||||
|
group "icecast" {
|
||||||
|
count = 1
|
||||||
|
|
||||||
|
network {
|
||||||
|
|
||||||
|
port "icecast" {
|
||||||
|
static = 8000
|
||||||
|
to = 8000
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
restart {
|
||||||
|
attempts = 2
|
||||||
|
interval = "5m"
|
||||||
|
delay = "30s"
|
||||||
|
mode = "delay"
|
||||||
|
}
|
||||||
|
|
||||||
|
task "icecast" {
|
||||||
|
driver = "docker"
|
||||||
|
|
||||||
|
config {
|
||||||
|
image = "moul/icecast"
|
||||||
|
ports = ["icecast"]
|
||||||
|
}
|
||||||
|
env {
|
||||||
|
//TODO :)
|
||||||
|
#ICECAST_SOURCE_PASSWORD=""
|
||||||
|
#ICECAST_ADMIN_PASSWORD=bbbb
|
||||||
|
#ICECAST_PASSWORD=cccc
|
||||||
|
#ICECAST_RELAY_PASSWORD=dddd
|
||||||
|
}
|
||||||
|
|
||||||
|
service {
|
||||||
|
name = "icecast"
|
||||||
|
port = "icecast"
|
||||||
|
provider = "nomad"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
6
terraform/modules/icecast/job.tf
Normal file
6
terraform/modules/icecast/job.tf
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
resource "nomad_job" "app" {
|
||||||
|
jobspec = templatefile("${path.module}/conf/icecast.hcl", {
|
||||||
|
NOMAD_ALLOC_DIR = "/alloc"
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
9
terraform/modules/icecast/providers..tf
Normal file
9
terraform/modules/icecast/providers..tf
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
terraform {
|
||||||
|
required_providers {
|
||||||
|
nomad = {
|
||||||
|
source = "hashicorp/nomad"
|
||||||
|
version = "2.0.0-rc.1"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
required_version = ">= 0.14"
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue