-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path009_loki_0-bootstrap.yml
53 lines (51 loc) · 1.47 KB
/
009_loki_0-bootstrap.yml
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
---
- hosts: localhost
vars:
containers:
- loki01
tasks:
- name: spin up LXD container
ansible.builtin.include_tasks: common_lxdct.yml
with_items: '{{ containers }}'
- hosts: loki01
roles:
- basic
- prom_monitored
- loki_monitored
tasks:
- name: prepare loki user
ansible.builtin.user:
name: loki
system: true
createhome: true
home: /srv/loki
- name: fetch loki binary
ansible.builtin.unarchive:
src: https://github.com/grafana/loki/releases/download/{{ loki_ver }}/loki-linux-amd64.zip
remote_src: true
dest: /srv/loki
- name: deploy service file
ansible.builtin.template:
src: loki/loki.service
dest: /lib/systemd/system/loki.service
- name: configure system settings, file descriptors and number of threads
community.general.pam_limits:
domain: ratuser
limit_type: "{{ item.limit_type }}"
limit_item: "{{ item.limit_item }}"
value: "{{ item.value }}"
with_items:
- limit_type: '-'
limit_item: 'nofile'
value: 65536
- limit_type: '-'
limit_item: 'nproc'
value: 65536
- limit_type: 'soft'
limit_item: 'memlock'
value: unlimited
- limit_type: 'hard'
limit_item: 'memlock'
value: unlimited
- name: reload settings from all system configuration files
ansible.builtin.shell: sysctl --system