aboutsummaryrefslogtreecommitdiffstats
path: root/roles/loki/tasks/main.yml
blob: 4584da1e7559bbe04587d86152befe0334bfb304 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
- name: install loki
  package:
    name: loki
    state: present

- name: generate loki configuration
  template: &config_gen
    src: loki.yml.j2
    dest: "{{ loki_configuration_file }}"
    owner: 0
    group: 0
    mode: 0644

- name: generate promtail configuration
  template:
    <<: *config_gen
    src: promtail.yml.j2
    dest: "{{ loki_promtail_configuration_file }}"

- name: add loki user to wheel group
  user:
    name: "{{ loki_user }}"
    groups:
      - 0
      - daemon
    append: true

- name: enable and restart loki daemons
  service:
    name: "{{ item }}"
    state: restarted
    enabled: true
  loop:
    - loki
    - promtail
remember that computers suck.