Commit 8c32e8b0 authored by Benjamin DUPUIS's avatar Benjamin DUPUIS
Browse files

initial

parents
---
loki:
server:
install_dir: /opt
config:
auth_enabled: false
server:
http_listen_port: 3100
ingester:
lifecycler:
address: 127.0.0.1
ring:
kvstore:
store: inmemory
replication_factor: 1
final_sleep: 0s
chunk_idle_period: 5m
chunk_retain_period: 30s
schema_config:
configs:
- from: 2018-04-15
store: boltdb
object_store: filesystem
schema: v9
index:
prefix: index_
period: 168h
storage_config:
boltdb:
directory: /var/lib/loki/index
filesystem:
directory: /var/lib/loki/chunks
limits_config:
enforce_metric_name: false
reject_old_samples: true
reject_old_samples_max_age: 168h
chunk_store_config:
max_look_back_period: 0
table_manager:
chunk_tables_provisioning:
inactive_read_throughput: 0
inactive_write_throughput: 0
provisioned_read_throughput: 0
provisioned_write_throughput: 0
index_tables_provisioning:
inactive_read_throughput: 0
inactive_write_throughput: 0
provisioned_read_throughput: 0
provisioned_write_throughput: 0
retention_deletes_enabled: false
retention_period: 0
promtail:
install_dir: /opt
config:
server:
http_listen_port: 9080
grpc_listen_port: 0
positions:
filename: /opt/promtail/positions.yaml
clients:
- url: http://localhost:3100/api/prom/push
scrape_configs:
- job_name: journal
journal:
path: /run/log/journal
labels:
job: systemd-journal
relabel_configs:
- source_labels: ['__journal__systemd_unit']
target_label: 'unit'
...
{% from "loki/map.jinja" import loki with context %}
include:
{%- if loki.server.enable %}
- loki.server
{%- endif %}
{%- if loki.promtail.enable %}
- loki.promtail
{%- endif %}
{% import_yaml "loki/defaults.yaml" as default_settings %}
{% set loki = salt['pillar.get'](
'loki',
default=default_settings.loki,
merge=True)
%}
{% from "loki/map.jinja" import loki with context %}
promtail:
user.present:
- fullname: promtail daemon
- group: root
- system: True
promtail_install_dir:
file.directory:
- name: "{{ loki.promtail.install_dir }}/promtail"
- user: root
- group: root
- mode: 0755
promtail_binary:
file.managed:
- name: "{{ loki.promtail.install_dir }}/promtail/promtail"
- user: root
- group: root
- mode: '0755'
- source: "{{ loki.promtail.source }}"
promtail_service_file:
file.managed:
- name: /etc/systemd/system/promtail.service
- replace: False
- user: root
- group: root
- mode: '0644'
/etc/systemd/system/promtail.service:
ini.options_present:
- separator: '='
- strict: True
- sections:
Unit:
Description: Promtail Server
After: network-online.target
Service:
User: loki
Restart: on-failure
ExecStart: {{ loki.promtail.install_dir }}/promtail/promtail -config.file {{ loki.promtail.install_dir }}/promtail/promtail.yml
Install:
WantedBy: multi-user.target
{{ loki.promtail.install_dir }}/promtail/promtail.yml:
file.serialize:
- dataset:
{{ loki.promtail.config | yaml() | indent(8) }}
- formatter: yaml
- user: root
- group: root
- mode: '0644'
{% from "loki/map.jinja" import loki with context %}
loki:
user.present:
- fullname: loki daemon
- system: True
loki_install_dir:
file.directory:
- name: "{{ loki.server.install_dir }}/loki"
- user: loki
- group: loki
loki_binary:
file.managed:
- name: "{{ loki.server.install_dir }}/loki/loki"
- user: root
- group: root
- mode: '0755'
- source: "{{ loki.server.source }}"
loki_service_file:
file.managed:
- name: /etc/systemd/system/loki.service
- replace: False
- user: root
- group: root
- mode: '0644'
/etc/systemd/system/loki.service:
ini.options_present:
- separator: '='
- strict: True
- sections:
Unit:
Description: Loki Server
After: network-online.target
Service:
User: loki
Restart: on-failure
ExecStart: {{ loki.server.install_dir }}/loki/loki -config.file {{ loki.server.install_dir }}/loki/loki.yml
Install:
WantedBy: multi-user.target
{{ loki.server.install_dir }}/loki/loki.yml:
file.serialize:
- dataset:
{{ loki.server.config | yaml() | indent(8) }}
- formatter: yaml
- user: root
- group: root
- mode: '0644'
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