Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Arch Linux
infrastructure
Commits
7235e726
Verified
Commit
7235e726
authored
Feb 26, 2021
by
Kristian Klausen
🎉
Committed by
Jelle van der Waa
Apr 08, 2021
Browse files
Implement centralized logging
Fix #263
parent
99d76922
Changes
42
Hide whitespace changes
Inline
Side-by-side
roles/promtail/tasks/main.yml
0 → 100644
View file @
7235e726
---
-
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
roles/promtail/templates/promtail.yaml.j2
0 → 100644
View file @
7235e726
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
Prev
1
2
3
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment