From 760af8dabe015dfe2fea404bdc9e2266c661f7cb Mon Sep 17 00:00:00 2001 From: Jacob Babor Date: Sun, 11 Aug 2024 11:08:23 -0500 Subject: [PATCH] Fix up music stuffs --- playbooks/prod_web.yml | 3 --- playbooks/tasks/web/navidrome.yml | 1 + roles/prometheus/templates/prometheus.yml.j2 | 21 ++++++++++++++++++++ 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/playbooks/prod_web.yml b/playbooks/prod_web.yml index b6ef37f..185c284 100755 --- a/playbooks/prod_web.yml +++ b/playbooks/prod_web.yml @@ -140,9 +140,6 @@ proxy_pass: http://prometheus:9090 # desu.ltd media bullshit - name: music.desu.ltd - directives: - - "allow {{ common_home_address }}/{{ common_home_address_mask }}" - - "deny all" proxy_pass: http://navidrome:4533 - name: lidarr.media.desu.ltd directives: diff --git a/playbooks/tasks/web/navidrome.yml b/playbooks/tasks/web/navidrome.yml index 4f605d6..3a8df6d 100644 --- a/playbooks/tasks/web/navidrome.yml +++ b/playbooks/tasks/web/navidrome.yml @@ -6,6 +6,7 @@ user: 911:911 env: ND_BASEURL: "https://music.desu.ltd" + ND_PROMETHEUS_ENABLED: "true" ND_LOGLEVEL: "info" networks: - name: web diff --git a/roles/prometheus/templates/prometheus.yml.j2 b/roles/prometheus/templates/prometheus.yml.j2 index 2f0a706..42d3a61 100644 --- a/roles/prometheus/templates/prometheus.yml.j2 +++ b/roles/prometheus/templates/prometheus.yml.j2 @@ -81,6 +81,27 @@ scrape_configs: {# #} {% endfor %} {% endfor %} +{% endfor %} + + # This job takes in information from Netbox on the generic "prom-metrics" tag + # It's useful for all sorts of stuff + - job_name: "generic" + scheme: "https" + static_configs: + - targets: +{% for host in groups['tags_nagios'] %} +{% set vars = hostvars[host] %} +{% for service in vars.services %} +{% for tag in service.tags %} +{# #} +{% if tag.slug == "prom-metrics" %} +{% for port in service.ports %} + - "{{ service.name }}:{{ port }}" +{% endfor %} +{% endif %} +{# #} +{% endfor %} +{% endfor %} {% endfor %} # These two jobs are included for every node in our inventory