fix: reset connection after httpapi tasks in k8s-zabbix to prevent var bleed #60

Closed
opened 2026-05-16 02:44:48 +00:00 by mconway · 0 comments
Owner

The SAML and Matrix tasks in ansible/roles/k8s-zabbix/tasks/main.yml set ansible_connection: httpapi and ansible_host: zabbix.conways.info as task-level vars. Ansible's connection cache retains this state, causing subsequent roles in the same play (e.g. k8s-alerta) to connect to zabbix.conways.info instead of the actual host via SSH.

Symptom: postgresql-backup fails with Failed to find required executable "apt-key" because it is running against the Zabbix container rather than the k3s node.

Fix

Add meta: reset_connection after the httpapi task blocks in k8s-zabbix/tasks/main.yml to flush the cached connection and restore normal SSH behaviour for subsequent roles.

Affected tasks

  • Create new user directory with SAML IDP
  • Configure Zabbix Matrix Alerts (imports zabbix-matrix.yml)
The SAML and Matrix tasks in `ansible/roles/k8s-zabbix/tasks/main.yml` set `ansible_connection: httpapi` and `ansible_host: zabbix.conways.info` as task-level vars. Ansible's connection cache retains this state, causing subsequent roles in the same play (e.g. `k8s-alerta`) to connect to `zabbix.conways.info` instead of the actual host via SSH. Symptom: `postgresql-backup` fails with `Failed to find required executable "apt-key"` because it is running against the Zabbix container rather than the k3s node. ## Fix Add `meta: reset_connection` after the httpapi task blocks in `k8s-zabbix/tasks/main.yml` to flush the cached connection and restore normal SSH behaviour for subsequent roles. ## Affected tasks - `Create new user directory with SAML IDP` - `Configure Zabbix Matrix Alerts` (imports `zabbix-matrix.yml`)
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
mconway/Homelab#60
No description provided.