Files
computer-playbook/roles/web-app-prometheus/vars/main.yml
kevinveenbirkenbachandClaude Opus 5 30d8671c39 refactor(mcp): let the sidecar entry be the switch, not the topic
Thirteen of sixteen MCP sidecar entries carried no enabled at all, so
collect_role_resources fell back to _looks_like_container and billed every
one of them as running. Three roles already gated theirs on mcp.enabled;
the rest now do the same, gitea twice because it is the only role with a
vendor container behind the adapter.

The fifteen adapter roles then read services.<key>.enabled instead of
mcp.enabled, so the compose block and the task gates follow the services
entry rather than running beside it on a second path. The six plugin and
native roles keep reading the topic: they ship no sidecar entry to point at.

The three-level resolution is not new. KEYCLOAK_LOGOUT_PANEL_ENABLED has
the same shape and depth and gates a task the same way, and the same value
reaches JAVASCRIPT_SERVICE_ENABLED, where service-gating.js throws on
anything but "true" or "false" — an unresolved chain would have been
killing keycloak's Playwright run since 575a5a87ac.

This does not change what the resource model counts: _is_enabled reads the
unrendered Jinja and still treats it as on. What it buys is one switch
instead of two, and a declaration that matches it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-01 17:42:33 +02:00

46 lines
3.3 KiB
YAML

---
application_id: "web-app-prometheus"
PROMETHEUS_CONTAINER: "{{ lookup('config', application_id, 'services.prometheus.name') }}"
PROMETHEUS_CONFIG_HOST: "{{ [ lookup('container', application_id, 'directories.config'), 'prometheus.yml' ] | path_join }}"
PROMETHEUS_CONFIG_DOCKER: "{{ lookup('volume', 'web-app-prometheus', 'prometheus_config').target }}"
BLACKBOX_CONFIG_HOST: "{{ [ lookup('container', application_id, 'directories.config'), 'blackbox.yml' ] | path_join }}"
BLACKBOX_CONFIG_DOCKER: "{{ lookup('volume', 'web-app-prometheus', 'blackbox_config').target }}"
ALERTMANAGER_CONTAINER: "{{ lookup('config', application_id, 'services.alertmanager.name') }}"
ALERTMANAGER_CONFIG_HOST: "{{ [ lookup('container', application_id, 'directories.config'), 'alertmanager.yml' ] | path_join }}"
ALERTMANAGER_CONFIG_DOCKER: "{{ lookup('volume', 'web-app-prometheus', 'alertmanager_config').target }}"
ALERT_RULES_CONFIG_HOST: "{{ [ lookup('container', application_id, 'directories.config'), 'alert_rules.yml' ] | path_join }}"
ALERT_RULES_CONFIG_DOCKER: "{{ lookup('volume', 'web-app-prometheus', 'alert_rules').target }}"
ALERTMANAGER_TELEGRAM_BOT_TOKEN: "{{ lookup('config', application_id, 'secrets.credentials.alerting_telegram_bot_token', '') }}"
ALERTMANAGER_TELEGRAM_CHAT_ID: "{{ lookup('config', application_id, 'services.prometheus.alerting.telegram.chat_id') }}"
ALERTMANAGER_MATTERMOST_WEBHOOK_URL: "{{ lookup('config', application_id, 'secrets.credentials.alerting_mattermost_webhook_url', '') }}"
BLACKBOX_CONTAINER: "{{ lookup('config', application_id, 'services.blackbox-exporter.name') }}"
CADVISOR_CONTAINER: "{{ lookup('config', application_id, 'services.cadvisor.name') }}"
NODE_EXPORTER_CONTAINER: "{{ lookup('config', application_id, 'services.node-exporter.name') }}"
PROMETHEUS_QUERY_TIMEOUT: "{{ (lookup('config', application_id, 'mcp.limits.timeout_seconds') | int * 2) ~ 's' }}"
PROMETHEUS_MCP_ENABLED: "{{ lookup('config', application_id, 'services.prometheusmcp.enabled') | bool }}"
PROMETHEUS_MCP_SERVICE_KEY: "prometheusmcp"
PROMETHEUS_MCP_CONTAINER: "{{ lookup('config', application_id, 'services.prometheusmcp.name') }}"
PROMETHEUS_MCP_PORT: "{{ lookup('config', application_id, 'services.prometheusmcp.ports.internal.http') }}"
PROMETHEUS_MCP_BEARER: "{{ lookup('config', application_id, 'secrets.credentials.mcp_bearer') }}"
PROMETHEUS_MCP_INSTANCE_DIR: "{{ [lookup('container', application_id, 'directories.instance'), 'mcp'] | path_join }}"
PROMETHEUS_MCP_UPSTREAM_HOST: "{{ lookup('config', application_id, 'services.prometheus.name') }}"
PROMETHEUS_MCP_UPSTREAM_PORT: "{{ lookup('config', application_id, 'services.prometheus.ports.internal.http') }}"
PROMETHEUS_MCP_UPSTREAM_URL: "http://{{ PROMETHEUS_MCP_UPSTREAM_HOST }}:{{ PROMETHEUS_MCP_UPSTREAM_PORT }}"
PROMETHEUS_MCP_CONTRACT:
provider: "{{ application_id }}"
upstream_url: "{{ PROMETHEUS_MCP_UPSTREAM_URL }}"
auth_subject: "{{ lookup('config', application_id, 'mcp.auth_subject') }}"
mutating_tools_enabled: "{{ lookup('config', application_id, 'mcp.tools.mutating_tools_enabled') | bool }}"
tools: "{{ lookup('file', 'mcp/tools.json') | from_json }}"
limits: "{{ lookup('config', application_id, 'mcp.limits') }}"
schema_sha256: "{{ lookup('config', application_id, 'mcp.tools.schema_sha256') }}"
PROMETHEUS_MCP_UPSTREAM_KEY: ""