ansible-infra/ansible_collections/grafana/grafana/examples/promtail-multiple-logs.yml
Stefan Bethke 2aed20393f
Some checks failed
/ Ansible Lint (push) Failing after 5m45s
/ Ansible Lint (pull_request) Failing after 4m59s
Vendor Galaxy Roles and Collections
2026-02-06 22:07:16 +01:00

24 lines
684 B
YAML

---
- name: Deploy Promtail to ship logs to the local Loki instance
hosts: all
become: true
roles:
- role: grafana.grafana.promtail
vars:
promtail_clients:
- url: http://localhost:3100/loki/api/v1/push
promtail_scrape_configs:
- job_name: system
static_configs:
- targets:
- localhost
labels:
job: messages
instance: "{{ ansible_facts['fqdn'] }}"
__path__: /var/log/messages
- targets:
- localhost
labels:
job: nginx
instance: "{{ ansible_facts['fqdn'] }}"
__path__: /var/log/nginx/*.log