diff --git a/README.md b/README.md index f32b2a0..30b0129 100644 --- a/README.md +++ b/README.md @@ -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. @@ -27,4 +34,4 @@ WTFPL see [LICENSE](license) Author Information ------------------ -https://diogenxs.dev \ No newline at end of file +https://diogenxs.dev diff --git a/defaults/main.yml b/defaults/main.yml index f74460d..7e677a8 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -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" @@ -100,4 +101,4 @@ promtail_scrape_config: promtail_target_config: [] promtail_positions_config: - filename: /tmp/positions.yaml \ No newline at end of file + filename: /tmp/positions.yaml diff --git a/handlers/main.yml b/handlers/main.yml index a3c4fcf..0d2e77c 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -5,6 +5,7 @@ daemon_reload: true name: loki state: restarted + enabled: true when: ('loki' in loki_bins) - name: reload loki @@ -20,6 +21,7 @@ daemon_reload: true name: promtail state: restarted + enabled: true when: ('promtail' in loki_bins) - name: reload promtail @@ -27,4 +29,4 @@ systemd: name: promtail state: reloaded - when: ('promtail' in loki_bins) \ No newline at end of file + when: ('promtail' in loki_bins) diff --git a/templates/loki.yml.j2 b/templates/loki.yml.j2 index 5438373..c627621 100644 --- a/templates/loki.yml.j2 +++ b/templates/loki.yml.j2 @@ -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 %}