aboutsummaryrefslogblamecommitdiffstats
path: root/roles/loki/tasks/main.yml
blob: 1995f1203bd3b53bb85370e0c5b82e3630b30a98 (plain) (tree)
1
2
3
4
5
6
7
8
9

   
                    
                          



                                   
                                       






                                         
                           




                                                  
                       






                                       
                          





                      
---

- name: install loki
  ansible.builtin.package:
    name: loki
    state: present

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

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

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

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