switched zabbix-server to podman
This commit is contained in:
parent
8cf21efc5a
commit
55ea3a2a8e
1 changed files with 29 additions and 22 deletions
|
|
@ -1,9 +1,13 @@
|
|||
{ pkgs, lib, ... }:
|
||||
let
|
||||
db = "zabbix";
|
||||
db_host = "10.88.0.1";
|
||||
version = "latest";
|
||||
port = "8999";
|
||||
domain = "zbx.mc-fucker.cool";
|
||||
podman_dns = "--dns=100.100.100.100";
|
||||
server_ip = "10.88.1.0";
|
||||
web_ip = "10.88.1.1";
|
||||
in
|
||||
{
|
||||
services.postgresql = {
|
||||
|
|
@ -22,34 +26,36 @@ in
|
|||
settings = {
|
||||
shared_preload_libraries = "timescaledb";
|
||||
};
|
||||
authentication = "host ${db} ${db} zabbix-server.mc-fucker.vpn.mc-fucker.cool md5";
|
||||
authentication = "host ${db} ${db} 10.88.0.0/16 md5";
|
||||
};
|
||||
|
||||
services.zabbixServer = {
|
||||
enable = true;
|
||||
database = {
|
||||
createLocally = false;
|
||||
socket = "/run/postgresql";
|
||||
passwordFile = /etc/nixos/keys/zabbix_db.key;
|
||||
virtualisation.oci-containers.containers.zabbix-server = {
|
||||
image = "zabbix/zabbix-server-pgsql:alpine-6.2-latest";
|
||||
environment = {
|
||||
DB_SERVER_HOST = db_host;
|
||||
POSTGRES_USER = db;
|
||||
};
|
||||
package = (pkgs.callPackages ../packages/zabbix/server.nix { postgresqlSupport = true; }).${version};
|
||||
environmentFiles = [ /etc/nixos/keys/zabbix-env ];
|
||||
extraOptions = [
|
||||
podman_dns
|
||||
"--ip=${server_ip}"
|
||||
];
|
||||
};
|
||||
|
||||
services.zabbixWeb = {
|
||||
enable = true;
|
||||
package = (pkgs.callPackages ../packages/zabbix/web.nix {}).${version};
|
||||
database = {
|
||||
socket = "/run/postgresql";
|
||||
};
|
||||
virtualHost = {
|
||||
hostName = domain;
|
||||
adminAddr = "noreply@mc-fucker.cool";
|
||||
listen = [
|
||||
{
|
||||
port = (lib.strings.toInt port);
|
||||
}
|
||||
];
|
||||
virtualisation.oci-containers.containers.zabbix-web = {
|
||||
image = "zabbix/zabbix-web-nginx-pgsql:alpine-6.2-latest";
|
||||
environment = {
|
||||
DB_SERVER_HOST = db_host;
|
||||
POSTGRES_USER = db;
|
||||
ZBX_SERVER_HOST = server_ip;
|
||||
PHP_TZ = "Europe/Berlin";
|
||||
};
|
||||
environmentFiles = [ /etc/nixos/keys/zabbix-env ];
|
||||
extraOptions = [
|
||||
podman_dns
|
||||
"--ip=${web_ip}"
|
||||
];
|
||||
ports = [ "${port}:8080" ];
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts.${domain} = {
|
||||
|
|
@ -64,6 +70,7 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
networking.firewall.interfaces.podman0.allowedTCPPorts = [ 5432 ];
|
||||
}
|
||||
|
||||
# vim: set et ts=2 sw=2 ai:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue