main.yml 1003 Bytes
Newer Older
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
---
- name: create ssl cert
  include_role:
    name: certificate
  vars:
    domains: ["{{ logging_domain }}"]

- name: install loki and logcli
  pacman: name=loki,logcli state=present

- name: install loki configuration
  copy: src=loki.yaml dest=/etc/loki/ owner=root group=root mode=0644
  notify: restart loki

- name: install python-passlib
  pacman: name=python-passlib

- name: create htpasswd for nginx loki endpoint
  htpasswd:
    path: "{{ loki_nginx_htpasswd }}"
    name: "{{ vault_loki_nginx_user }}"
    password: "{{ vault_loki_nginx_passwd }}"
    owner: root
    group: http
    mode: 0640

- name: make nginx log dir
  file: path=/var/log/nginx/{{ logging_domain }} state=directory owner=root group=root mode=0755

- name: set up nginx
  template: src=nginx.d.conf.j2 dest="/etc/nginx/nginx.d/logging.conf" owner=root group=root mode=644
  notify: reload nginx
  tags: ['nginx']

- name: start and enable loki
  systemd: name=loki.service enabled=yes daemon_reload=yes state=started