ansible-role-loki/tasks/main.yml
2022-11-29 18:58:41 +01:00

47 lines
800 B
YAML

---
- name: Create user loki
user:
name: loki
system: yes
group: root
- name: copy loki binaries
copy:
src: loki-linux-amd64
dest: /usr/local/bin/loki
owner: root
group: root
mode: '0755'
backup: no
- name: generate /etc/systemd/system/loki.service
template:
src: loki.service.j2
dest: /etc/systemd/system/loki.service
owner: root
group: root
mode: "0644"
notify:
- restart loki
- name: enable loki
systemd:
name: loki
enabled: yes
masked: no
notify:
- restart loki
- name: generate /etc/loki-local-config.yaml
template:
src: loki-local-config.yaml.j2
dest: /etc/loki.yaml
owner: root
group: root
mode: "0644"
notify:
- restart loki
- name: Flush handlers
meta: flush_handlers