commit ed1bf6f558b964ae3a41c47fbdd178515127d341 Author: Alex Date: Mon Aug 25 16:03:10 2025 +0200 first commit diff --git a/infrastructure/syslog/deploy b/infrastructure/syslog/deploy new file mode 100644 index 0000000..69f7b02 --- /dev/null +++ b/infrastructure/syslog/deploy @@ -0,0 +1,12 @@ +sudo podman run -d \ + --name=syslog-ng \ + -e PUID=1000 \ + -e PGID=1000 \ + -e TZ=Etc/UTC \ + -p 514:5514/udp \ + -p 601:6601/tcp \ + -p 6514:6514/tcp \ + -v /srv/syslog/config:/config \ + -v /srv/syslog/log:/var/log \ + --restart unless-stopped \ + lscr.io/linuxserver/syslog-ng:latest \ No newline at end of file diff --git a/infrastructure/syslog/main.tf b/infrastructure/syslog/main.tf new file mode 100644 index 0000000..8781c0a --- /dev/null +++ b/infrastructure/syslog/main.tf @@ -0,0 +1,54 @@ +terraform { + required_providers { + podman = { + source = "project0/podman" + } + } +} + +provider "podman" { + uri = "unix:///run/podman/podman.sock" +} + +resource "podman_container" "syslog_ng" { + name = "syslog-ng" + image = "lscr.io/linuxserver/syslog-ng:latest" + restart = "unless-stopped" + + # Environment variables + env = { + PUID = "1000" + PGID = "1000" + TZ = "Etc/UTC" + } + + # Port mappings + ports { + host_port = 514 + container_port = 5514 + protocol = "udp" + } + + ports { + host_port = 601 + container_port = 6601 + protocol = "tcp" + } + + ports { + host_port = 6514 + container_port = 6514 + protocol = "tcp" + } + + # Volume mounts + volumes { + host_path = "/srv/syslog/config" + container_path = "/config" + } + + volumes { + host_path = "/srv/syslog/log" + container_path = "/var/log" + } +} diff --git a/infrastructure/terraform/Dockerfile b/infrastructure/terraform/Dockerfile new file mode 100644 index 0000000..f6f1460 --- /dev/null +++ b/infrastructure/terraform/Dockerfile @@ -0,0 +1 @@ +FROM hashicorp/terraform:1.13 \ No newline at end of file diff --git a/infrastructure/terraform/deploy b/infrastructure/terraform/deploy new file mode 100644 index 0000000..0577cb5 --- /dev/null +++ b/infrastructure/terraform/deploy @@ -0,0 +1,6 @@ +podman run --rm -it \ + -v /run/user/$UID/podman/podman.sock:/var/run/podman/podman.sock \ + -v $(pwd):/workspace \ + -w /workspace \ + -e PODMAN_SOCK=unix:///var/run/podman/podman.sock \ + terraform-podman plan