Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions roles/loki/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ nginx_proxies:
options: |
include /etc/nginx/conf.d/proxies/loki.nginx;
```
or if loki runs on a dedicated domain

```yml
nginx_proxies:
- src_hostname: server.example.com
ssl: true
options: |
include /etc/nginx/conf.d/proxies/loki-dedicated-domain.nginx;
```

And include it in your playbook.

Expand Down
1 change: 1 addition & 0 deletions roles/loki/tasks/loki.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
volumes:
- "{{ loki_data_dir }}:/etc/loki"
command: -config.file=/etc/loki/local-config.yml -config.expand-env=true
network_mode: bridge
networks:
- name: "{{ docker_network_name }}"
log_driver: "{{ docker_log_driver }}"
Expand Down
5 changes: 5 additions & 0 deletions roles/loki/tasks/loki_nginx_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,8 @@
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"
6 changes: 6 additions & 0 deletions roles/loki/templates/loki-dedicated-domain.nginx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

location / {
auth_basic "{{ loki_proxy_basic_auth_username }}";
auth_basic_user_file /etc/nginx/conf.d/proxies/loki.htpasswd;
proxy_pass http://{{ loki_hostname }}:3100;
}
2 changes: 1 addition & 1 deletion roles/prometheus/templates/prometheus.yml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to keep the pattern with the exporter attribute, even though it looks very complicated for defining one hostname.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had real issues with that, the cert_bot failed while deploying

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@janikvonrotz I've fixed the other issues above by moving everything in vars/inventory

I still would like to recommend the change below, because the certbot failed with that. maybe you can reproduce it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@oliverbeck-dev Not sure how certbot is involved here.

The exporter: uptime-kuma proxyies entry does not have any functionality. It is just a label for the proxy entry.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok I wasn't able to reproduce it with ansible-play prometheus.yml. I just remember that when I used the ansible-play certbot (for the new subdomain), it crashed because of that.

let's remove it for now

Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ scrape_configs:
username: {{ prometheus_uptime_kuma_exporter_basic_auth_username }}
password: {{ prometheus_uptime_kuma_exporter_basic_auth_password }}
static_configs:
- targets: {{ prometheus_hosts | map('extract', hostvars) | json_query('[*].nginx_proxies[?exporter!=null && contains(exporter, `uptime-kuma`)].src_hostname') | flatten }}
- targets: ['{{ uptime_kuma_hostname }}']
{% endif %}
{% if prometheus_meilisearch_exporter_api_key is defined %}
- job_name: meilisearch https
Expand Down