update
This commit is contained in:
16
terraform/main.tf
Normal file
16
terraform/main.tf
Normal file
@@ -0,0 +1,16 @@
|
||||
terraform {
|
||||
required_providers {
|
||||
podman = {
|
||||
source = "containers/podman"
|
||||
version = "0.0.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
provider "podman" {
|
||||
uri = "unix:///run/podman/podman.sock"
|
||||
}
|
||||
|
||||
module "syslog" {
|
||||
source = "./modules/syslog"
|
||||
}
|
||||
12
terraform/modules/syslog/deploy
Normal file
12
terraform/modules/syslog/deploy
Normal file
@@ -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
|
||||
42
terraform/modules/syslog/main.tf
Normal file
42
terraform/modules/syslog/main.tf
Normal file
@@ -0,0 +1,42 @@
|
||||
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"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user