Refactor tasks for compose.yml and add tasks for pihole, homeassistant, and prometheus
Signed-off-by: TuDatTr <tuan-dat.tran@tudattr.dev>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
version: '3'
|
||||
services:
|
||||
db:
|
||||
container_name: zoneminder_db
|
||||
image: mariadb
|
||||
restart: always
|
||||
networks:
|
||||
@@ -17,6 +18,7 @@ services:
|
||||
- "MAX_LOG_NUMBER=20"
|
||||
- "TZ=Europe/Berlin"
|
||||
zoneminder:
|
||||
container_name: zoneminder
|
||||
image: ghcr.io/zoneminder-containers/zoneminder-base:latest
|
||||
restart: always
|
||||
stop_grace_period: 45s
|
||||
@@ -50,7 +52,7 @@ services:
|
||||
image: pihole/pihole:latest
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
net: {}
|
||||
- net
|
||||
ports:
|
||||
- "53:53/tcp"
|
||||
- "53:53/udp"
|
||||
@@ -58,7 +60,7 @@ services:
|
||||
- "8089:80/tcp"
|
||||
environment:
|
||||
- "WEBPASSWORD={{ vault_aya01_pihole_password }}"
|
||||
- "ServerIP=192.168.20.12"
|
||||
- "ServerIP={{aya01_ip}}"
|
||||
- "INTERFACE=eth0"
|
||||
- "DNS1=1.1.1.1"
|
||||
- "DNS1=1.0.0.1"
|
||||
@@ -109,15 +111,66 @@ services:
|
||||
- "{{ grafana_log }}:/var/log/grafana/"
|
||||
ports:
|
||||
- 3000:3000
|
||||
|
||||
soft-serve:
|
||||
image: charmcli/soft-serve:latest
|
||||
container_name: soft-serve
|
||||
networks:
|
||||
- net
|
||||
volumes:
|
||||
- "{{ softserve_data }}:/soft-serve"
|
||||
ports:
|
||||
- 23231:23231
|
||||
restart: unless-stopped
|
||||
|
||||
prometheus:
|
||||
image: prom/prometheus
|
||||
container_name: prometheus
|
||||
networks:
|
||||
- net
|
||||
volumes:
|
||||
- "{{ prm_config }}:/etc/prometheus"
|
||||
ports:
|
||||
- "{{ prm_port }}:9090"
|
||||
|
||||
exporter_mikrotik:
|
||||
container_name: exporter_mikrotik
|
||||
user: "{{ puid }}:{{ pgid }}"
|
||||
image: "nshttpd/mikrotik-exporter:{{ e_mikrotik_version }}"
|
||||
networks:
|
||||
- net
|
||||
volumes:
|
||||
- "{{ e_mikrotik_config }}:/config"
|
||||
environment:
|
||||
- "CONFIG_FILE=/config/config.yml"
|
||||
ports:
|
||||
- "{{ e_mikrotik_port }}:9436"
|
||||
restart: unless-stopped
|
||||
|
||||
netdata:
|
||||
image: netdata/netdata
|
||||
container_name: netdata
|
||||
hostname: "{{ aya01_host }}"
|
||||
networks:
|
||||
- net
|
||||
ports:
|
||||
- "{{netdata_port}}:19999"
|
||||
restart: unless-stopped
|
||||
cap_add:
|
||||
- SYS_PTRACE
|
||||
security_opt:
|
||||
- apparmor:unconfined
|
||||
volumes:
|
||||
- "{{netdata_config}}:/etc/netdata"
|
||||
- "{{netdata_lib}}:/var/lib/netdata"
|
||||
- "{{netdata_cache}}:/var/cache/netdata"
|
||||
- /etc/passwd:/host/etc/passwd:ro
|
||||
- /etc/group:/host/etc/group:ro
|
||||
- /proc:/host/proc:ro
|
||||
- /sys:/host/sys:ro
|
||||
- /etc/os-release:/host/etc/os-release:ro
|
||||
|
||||
|
||||
networks:
|
||||
zoneminder:
|
||||
net:
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
devices:
|
||||
- name: mikrotik
|
||||
address: "{{ e_mikrotik_ip }}"
|
||||
user: "{{ prm_user }}"
|
||||
password: "{{ vault_prm_user_password }}"
|
||||
|
||||
features:
|
||||
bgp: false
|
||||
dhcp: true
|
||||
dhcpv6: true
|
||||
dhcpl: true
|
||||
routes: true
|
||||
pools: true
|
||||
optics: true
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ global:
|
||||
# Attach these labels to any time series or alerts when communicating with
|
||||
# external systems (federation, remote storage, Alertmanager).
|
||||
external_labels:
|
||||
monitor: 'Mikrotik'
|
||||
monitor: 'tudattr'
|
||||
|
||||
# Alertmanager configuration
|
||||
alerting:
|
||||
@@ -37,18 +37,8 @@ scrape_configs:
|
||||
|
||||
#static_configs:
|
||||
#- targets: ['localhost:9090']
|
||||
|
||||
- job_name: Mikrotik
|
||||
- job_name: 'mikrotik'
|
||||
static_configs:
|
||||
- targets:
|
||||
- {{ mikrotik_ip }} # mikrotik_ip
|
||||
metrics_path: /snmp
|
||||
params:
|
||||
module: [mikrotik]
|
||||
relabel_configs:
|
||||
- source_labels: [__address__]
|
||||
target_label: __param_target
|
||||
- source_labels: [__param_target]
|
||||
target_label: instance
|
||||
- target_label: __address__
|
||||
replacement: mk_snmp_exporter:9116 # The SNMP exporter's real hostname:port.
|
||||
- "{{aya01_ip}}:{{ e_mikrotik_port }}"
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ services:
|
||||
- "traefik.http.routers.traefik.rule=Host(`traefik.{{local_domain}}`)"
|
||||
# - "traefik.http.routers.traefik.entrypoints=web"
|
||||
# - "traefik.http.services.traefik.loadbalancer.server.port=80"
|
||||
|
||||
ddns-updater:
|
||||
container_name: ddns-updater
|
||||
image: "ghcr.io/qdm12/ddns-updater"
|
||||
@@ -30,11 +31,11 @@ services:
|
||||
- "{{ ddns_updater_data }}:/updater/data/"
|
||||
ports:
|
||||
- 8000:8000/tcp
|
||||
|
||||
homeassistant:
|
||||
container_name: homeassistant
|
||||
image: "ghcr.io/home-assistant/home-assistant:stable"
|
||||
restart: unless-stopped
|
||||
# network_mode: host
|
||||
volumes:
|
||||
- "/etc/localtime:/etc/localtime:ro"
|
||||
- "{{ ha_config }}:/config/"
|
||||
@@ -49,6 +50,7 @@ services:
|
||||
- "traefik.http.routers.homeassistant.rule=Host(`hass.{{local_domain}}`)"
|
||||
# - "traefik.http.routers.homeassistant.entrypoints=web"
|
||||
# - "traefik.http.services.homeassistant.loadbalancer.server.port=8123"
|
||||
|
||||
pihole:
|
||||
container_name: pihole
|
||||
image: pihole/pihole:latest
|
||||
|
||||
Reference in New Issue
Block a user