Skip to content
This repository has been archived by the owner on Jun 21, 2022. It is now read-only.

Add Loki ruler config to loki.yml and defaults #3

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
Role Name
=========
# Fork of [diogenxs/ansible-role-loki](https://github.com/diogenxs/ansible-role-loki)

- Added enabling systemd service
- Added loki_ruler config

---

Ansible Role Loki
=================

Deploy and configure [Loki/Promtail](https://github.com/grafana/loki) using Ansible.

Expand Down Expand Up @@ -27,4 +34,4 @@ WTFPL see [LICENSE](license)
Author Information
------------------

https://diogenxs.dev
https://diogenxs.dev
3 changes: 2 additions & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ loki_table_manager_config:
retention_deletes_enabled: false
retention_period: 0s

loki_ruler_config: []

promtail_client_config:
- url: "http://{{ loki_listen_address }}:{{ loki_listen_port }}/loki/api/v1/push"
Expand All @@ -100,4 +101,4 @@ promtail_scrape_config:

promtail_target_config: []
promtail_positions_config:
filename: /tmp/positions.yaml
filename: /tmp/positions.yaml
4 changes: 3 additions & 1 deletion handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
daemon_reload: true
name: loki
state: restarted
enabled: true
when: ('loki' in loki_bins)

- name: reload loki
Expand All @@ -20,11 +21,12 @@
daemon_reload: true
name: promtail
state: restarted
enabled: true
when: ('promtail' in loki_bins)

- name: reload promtail
become: true
systemd:
name: promtail
state: reloaded
when: ('promtail' in loki_bins)
when: ('promtail' in loki_bins)
4 changes: 4 additions & 0 deletions templates/loki.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,7 @@ table_manager:
runtime_config:
{{ loki_runtime_config | to_nice_yaml(indent=2) | indent(2, False) }}
{% endif %}
{% if loki_ruler_config != [] %}
ruler:
{{ loki_ruler_config | to_nice_yaml(indent=2) | indent(2, False) }}
{% endif %}