Files
kevinveenbirkenbach 1b2849c104 fix(openwebui): skip the grant pass when the run discovered no providers
The group map is built by looping over the discovered MCP servers, so an
empty list left the variable undefined and the next task aborted. That
list became reachable-empty once discovery narrowed to the providers a
run actually deploys.

The consuming tasks move into their own file behind one condition rather
than taking a default, because an empty result is a different case and
not a missing value: defaulting it would reconcile the existing grants
against nothing and drop them.
2026-08-10 11:22:22 +02:00

21 lines
900 B
YAML

---
- name: "🔍 Resolve {{ application_id }} hosting node + container id"
ansible.builtin.include_tasks: "{{ lookup('path_absolute', 'roles/sys-svc-compose/tasks/utils/swarm/resolve_host_cid.yml') }}"
vars:
resolve_service_key: "{{ entity_name }}"
resolve_output_prefix: OPENWEBUI
resolve_compose_cid: "{{ OPENWEBUI_CONTAINER }}"
- name: "🔧 Map every discovered MCP server to its role's mcp group"
ansible.builtin.set_fact:
openwebui_mcp_groups: >-
{{ openwebui_mcp_groups | default({})
| combine({item.id: '/' ~ lookup('rbac_group_path', application_id=item.id, role='mcp')}) }}
loop: "{{ OPENWEBUI_MCP_SERVERS }}"
loop_control:
label: "{{ item.id }}"
- name: "🔌 Grant and persist the MCP tool servers this run discovered"
ansible.builtin.include_tasks: "{{ role_path }}/tasks/utils/mcp_grants.yml"
when: OPENWEBUI_MCP_SERVERS | length > 0