diff options
author | Romain Gonçalves <me@rgoncalves.se> | 2021-12-13 17:11:14 +0000 |
---|---|---|
committer | Romain Gonçalves <me@rgoncalves.se> | 2021-12-13 17:11:14 +0000 |
commit | 2c643ea5fbd02b50411bcba1f5df14a8c327fdb1 (patch) | |
tree | b6d28dceb42227ebbf9cc1e95b39cb6f2f849592 /roles/loki/tasks | |
parent | cffe3422c31f987eea301fcd79571546f9b9e02d (diff) | |
download | rules-2c643ea5fbd02b50411bcba1f5df14a8c327fdb1.tar.gz |
roles: Add loki and promtail configurations
Diffstat (limited to 'roles/loki/tasks')
-rw-r--r-- | roles/loki/tasks/main.yml | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/roles/loki/tasks/main.yml b/roles/loki/tasks/main.yml new file mode 100644 index 0000000..4584da1 --- /dev/null +++ b/roles/loki/tasks/main.yml @@ -0,0 +1,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 |