-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathloki_nginx_config.yml
More file actions
30 lines (25 loc) · 1000 Bytes
/
Copy pathloki_nginx_config.yml
File metadata and controls
30 lines (25 loc) · 1000 Bytes
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
---
- name: Ensure nginx data dir exists
ansible.builtin.file:
path: "{{ loki_nginx_data_dir }}"
state: directory
- name: Gather package facts
ansible.builtin.package_facts:
manager: auto
- name: Fail if package {{ loki_requires_package }} is not installed
ansible.builtin.fail:
msg: Package {{ loki_requires_package }} is not installed!
when: loki_requires_package not in ansible_facts.packages
- name: Configure user access for {{ role_name }}
community.general.htpasswd:
path: "{{ loki_nginx_data_dir }}/loki.htpasswd"
name: "{{ loki_proxy_basic_auth_username }}"
password: "{{ loki_proxy_basic_auth_password }}"
- name: Copy nginx {{ role_name }} conf
ansible.builtin.template:
src: loki.nginx
dest: "{{ loki_nginx_data_dir }}/loki.nginx"
- name: Copy nginx {{ role_name }} conf if loki runs on dedicated domain
ansible.builtin.template:
src: loki-dedicated-domain.nginx
dest: "{{ loki_nginx_data_dir }}/loki-dedicated-domain.nginx"