Files
computer-playbook/roles/web-app-hermes/vars/main.yml
kevinveenbirkenbachandClaude Opus 5 c9298033e6 fix(roles): define the entity_name these five roles read
Role vars do not cross role boundaries, so flowise, hermes, homeassistant,
openclaw and openwebui read nothing where they template entity_name into
resolve_service_key. Seventy-seven other roles set it on the line below
application_id.

Ansible does not stop for it. In compose the undefined value renders into task
names as "<< error 1 - 'entity_name' is undefined >>" and the play carries on,
because that path resolves through resolve_compose_cid and never reads the key.
Swarm templates it into a real argument and dies on the first task, and with
any_errors_fatal that ends the play. Reproduced both ways against a replica of
resolve_host_cid.yml: compose ok=4 failed=0, swarm "'entity_name' is undefined".

Nothing could have supplied it either - role vars reach neither a sibling
include nor the parent, so the value was always undefined rather than sometimes
borrowed from whichever role ran before.

The rule that comes with it compares consumption against definition, which no
existing check does; the four scanners under tests/lint/ansible/variables all
run the other way. It skips a file another role pulls in by absolute path,
since that file executes in the including role's scope and reads that role's
value, and it matches the variable rather than get_entity_name, the filter whose
name ends in it. Both exemptions cost a false finding each while I was writing
it. It caught two roles the review had missed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-30 00:37:24 +02:00

15 lines
983 B
YAML

---
application_id: "web-app-hermes"
entity_name: "{{ application_id | get_entity_name }}"
domain: "{{ lookup('domain', application_id) }}"
http_port: "{{ lookup('config', application_id, 'services.hermes.ports.local.http') }}"
HERMES_CONTAINER: "{{ lookup('config', application_id, 'services.hermes.name') }}"
HERMES_PORT_INTERNAL: "{{ lookup('config', application_id, 'services.hermes.ports.internal.http') }}"
HERMES_API_SERVER_KEY: "{{ lookup('config', application_id, 'secrets.credentials.api_server_key') }}"
HERMES_LITELLM_ENABLED: "{{ lookup('config', application_id, 'services.litellm.enabled') }}"
HERMES_LITELLM_API_KEY: "{{ lookup('config', application_id, 'secrets.credentials.litellm_api_key') }}"
HERMES_CONFIG_PATH_HOST: "{{ [ lookup('container', application_id, 'directories.config'), 'config.yaml' ] | path_join }}"
HERMES_DOCKER_USER_ID: 10000
HERMES_MCP_SERVERS: "{{ MCP_DISCOVERED_SERVERS if (lookup('config', application_id, 'mcp.enabled') | bool) else [] }}"