configure docker network separately

This commit is contained in:
2026-08-06 00:25:12 +02:00
parent c18487ac23
commit c349880bf5
9 changed files with 22 additions and 24 deletions
+1 -1
View File
@@ -6,5 +6,5 @@
grafana_version: "latest"
cadvisor_version: "0.46.0"
roles:
# - role: roles/docker
- role: roles/docker
- role: roles/prometheus-grafana
@@ -1,9 +1,4 @@
---
- name: Create a Docker network for Elasticsearch
docker_network:
name: elk_network
state: present
- name: Pull Elasticsearch Docker image
docker_image:
name: docker.elastic.co/elasticsearch/elasticsearch-wolfi:{{ elk_version }}
+11
View File
@@ -0,0 +1,11 @@
---
- name: Create a Docker network for Elasticsearch
docker_network:
name: elk_network
state: present
driver: bridge
ipam_config:
- subnet: "172.19.0.0/16"
gateway: "172.19.0.1"
iprange: "172.19.0.0/24"
+1
View File
@@ -2,6 +2,7 @@
# ensure we have variables from .env files
- include_tasks: ../roles/env/tasks/main.yml
- include_tasks: elk-network.yml
- include_tasks: elasticsearch.yml
- include_tasks: kibana.yml
- include_tasks: logstash.yml
+1 -6
View File
@@ -1,9 +1,4 @@
---
- name: Create a Docker network for Grafana
docker_network:
name: monitoring_network
state: present
- name: Create grafana datasources directory on host
file:
path: /etc/grafana/datasources
@@ -87,7 +82,7 @@
- /etc/grafana/datasources:/etc/grafana/provisioning/datasources
- /etc/grafana/dashboards:/etc/grafana/provisioning/dashboards
networks:
- name: monitoring_network
- name: monitoring
env:
GF_SECURITY_ADMIN_PASSWORD: "{{ env_vars.GRAFANA_PASSWORD }}" # Customize the password
+1 -6
View File
@@ -1,9 +1,4 @@
---
- name: Create a Docker network for loki
docker_network:
name: monitoring_network
state: present
- name: Pull loki Docker image
docker_image:
name: grafana/loki:latest
@@ -33,4 +28,4 @@
volumes:
- /etc/loki/config.yml:/etc/loki/config.yml
networks:
- name: monitoring_network
- name: monitoring
+1
View File
@@ -2,6 +2,7 @@
# ensure we have variables from .env files
- include_tasks: ../roles/env/tasks/main.yml
- include_tasks: monitoring-network.yml
- include_tasks: prometheus.yml
- include_tasks: grafana.yml
@@ -0,0 +1,5 @@
---
- name: Create a Docker network for Monitoring
docker_network:
name: monitoring
state: present
@@ -1,9 +1,4 @@
---
- name: Create a Docker network for Prometheus
docker_network:
name: monitoring_network
state: present
- name: Pull Prometheus Docker image
docker_image:
name: prom/prometheus
@@ -32,5 +27,5 @@
volumes:
- /etc/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
networks:
- name: monitoring_network
- name: monitoring