Add the monitoring stack

This commit is contained in:
tanshu committed 2026-10-18 21:35:52 +05:30
1 parent 5e0a27b32b
commit 924f000e17
14 files changed
+376

No files matched your search

@@ -0,0 +1,6 @@
---
# Default variables for Mosquitto role
mosquitto_user: "{{ ansible_user }}"
mosquitto_image: "mosquitto:latest"
mosquitto_directory: "/opt/mosquitto"
mosquitto_container: "mosquitto"
+44
View File
@@ -0,0 +1,44 @@
---
# The image is configured to run by default as user promtail with UID 10001 and GID 10001.
# You can use a different user, specially if you are using bind mounts, by specifying
# the UID with a docker run command and using --user=UID with a numeric UID suited to your needs.
# Tasks for Promtail role
- name: Pull Promtail image
docker_image:
name: "{{ promtail_image }}"
source: pull
force_source: yes
- name: Ensure Promtail Directory exists
file:
path: "{{ promtail_directory }}"
state: directory
group: "{{ promtail_user }}"
owner: "{{ promtail_user }}"
mode: 0755
- name: Copy the Promtail conf file
template:
src: "files/promtail-config.yaml"
dest: "{{ promtail_directory }}/promtail-config.yaml"
group: "{{ promtail_user }}"
owner: "{{ promtail_user }}"
mode: 0644
- name: Create Promtail container
docker_container:
name: "{{ promtail_container }}"
image: "{{ promtail_image }}"
state: started
restart_policy: "unless-stopped"
links:
- "{{ loki_container }}:loki"
volumes:
- "{{ promtail_directory }}:/mnt/config"
- "/var/log:/var/log:ro"
- "/var/lib/docker/containers:/var/lib/docker/containers:ro"
# published_ports:
# - "127.0.0.1:{{ promtail_port }}:9080"
command:
- "-config.file=/mnt/config/promtail-config.yaml"