Using Ansible variables in testinfra
问题 Using TestInfra with Ansible backend for testing purposes. Everything goes fine except using Ansible itself while running tests test.py import pytest def test_zabbix_agent_package(host): package = host.package("zabbix-agent") assert package.is_installed package_version = host.ansible("debug", "msg={{ zabbix_agent_version }}")["msg"] (...) where zabbix_agent_version is an Ansible variable from group_vars. It can be obtained by running this playbook - hosts: all become: true tasks: - name: