infra: Icecast deployment

This commit is contained in:
Luigi Oliveira 2024-01-03 22:14:30 -03:00
parent ae51769685
commit 5312262c3f
4 changed files with 69 additions and 0 deletions

View file

@ -27,6 +27,14 @@ module "keycloak" {
postgree_endpoint = var.endpoint
KC_USER = var.kc_user
KC_PASSWORD = var.kc_password
providers = {
nomad = nomad
}
}
module "icecast" {
source = "./modules/icecast"
providers = {
nomad = nomad
}

View 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"
}
}
}
}

View file

@ -0,0 +1,6 @@
resource "nomad_job" "app" {
jobspec = templatefile("${path.module}/conf/icecast.hcl", {
NOMAD_ALLOC_DIR = "/alloc"
})
}

View file

@ -0,0 +1,9 @@
terraform {
required_providers {
nomad = {
source = "hashicorp/nomad"
version = "2.0.0-rc.1"
}
}
required_version = ">= 0.14"
}