salt-states/containers/promtail.sls
2023-06-27 09:16:37 +02:00

35 lines
868 B
Plaintext

{%- set client_url = "http://loki.rre.nu:3100/loki/api/v1/push" %}
{%- set http_listen_port = 9080 %}
{% from 'lib.sls' import container_deploy with context %}
Create promtail configuration folder:
file.directory:
- name: /etc/promtail
- user: root
- group: root
- mode: "0755"
Create promtail configuration:
file.managed:
- name: /etc/promtail/promtail.conf
- source: salt://containers/files/promtail.conf.jinja
- template: jinja
- user: root
- group: root
- mode: "0644"
- require:
- file: Create promtail configuration folder
- context:
client_url: {{ client_url }}
http_listen_port: {{ http_listen_port }}
{{ container_deploy('promtail') }}
Start promtail service:
service.running:
- name: promtail.service
- enable: True
- watch:
- file: Create promtail configuration