Files
computer-playbook/roles/svc-virt-kata/tasks/utils/assert_isolated.yml
kevinveenbirkenbachandClaude Opus 5 c83b0b46fe fix(kata): move the nocheck directive out of the folded scalar
YAML treats # inside a block scalar as text, so the directive became part of the
command. ansible.builtin.command starts no shell and splits on whitespace, which
turned '#', 'nocheck:' and 'container-exec-resolver' into container names the
daemon then reported as missing. The real inspect succeeded; the non-zero exit
came only from those three.

Put the directive behind the scalar indicator, where YAML reads it as a comment,
matching how the rest of the repository writes it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-03 18:15:33 +02:00

20 lines
1017 B
YAML

---
# Param: assert_isolated_container - name of the container that must not run under the shared kernel
- name: "🔍 Read the runtime '{{ assert_isolated_container }}' actually got"
ansible.builtin.command: >- # nocheck: container-exec-resolver runtime probe, the container name comes from the caller
container inspect --type container {{ assert_isolated_container }}
--format {{ '{{.HostConfig.Runtime}}' }}
register: assert_isolated_runtime
changed_when: false
- name: "🛑 Refuse an agent running under the shared kernel"
ansible.builtin.assert:
that:
- (assert_isolated_runtime.stdout | trim) != 'runc'
fail_msg: >-
'{{ assert_isolated_container }}' runs under
'{{ assert_isolated_runtime.stdout | trim }}', which is the host kernel.
This container executes code the model wrote, so the deploy is refused
rather than left looking healthy. Check that svc-virt-kata installed the
isolating runtime on this host and that the daemon restarted onto it.