Verified Commit 7235e726 authored by Kristian Klausen's avatar Kristian Klausen 🎉 Committed by Jelle van der Waa
Browse files

Implement centralized logging

Fix #263
parent 99d76922
---
- name: install promtail
pacman: name=promtail state=present
- name: install promtail configuration
template: src=promtail.yaml.j2 dest=/etc/loki/promtail.yaml owner=root group=promtail mode=0640
notify: restart promtail
- name: open promtail ipv4 port for monitoring.archlinux.org
ansible.posix.firewalld: state=enabled permanent=true immediate=yes
rich_rule="rule family=ipv4 source address={{ hostvars['monitoring.archlinux.org']['ipv4_address'] }} port protocol=tcp port=9080 accept"
tags:
- firewall
- name: start and enable promtail
systemd: name=promtail.service enabled=yes daemon_reload=yes state=started
server:
http_listen_address: 127.0.0.1
http_listen_port: 9080
grpc_listen_address: 127.0.0.1
grpc_listen_port: 0 # 0 means random
positions:
filename: /var/lib/promtail/positions.yaml
clients:
- url: https://{{ logging_domain }}/loki/api/v1/push
basic_auth:
username: '{{ vault_loki_nginx_user }}'
password: '{{ vault_loki_nginx_passwd }}'
scrape_configs:
- job_name: journal
journal:
json: true
max_age: 72h
path: /var/log/journal
labels:
job: systemd-journal
relabel_configs:
- source_labels: ['__journal__systemd_unit']
target_label: unit
- source_labels: ["__journal__hostname"]
target_label: instance
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment