
Mudei para o AWX para gerenciar meus playbooks e não consigo resolver esse problema com o assert. Aqui está um papel que preparei:
- name: Run testing environment
docker_compose:
project_name: "testing"
definition:
version: '3.7'
services:
nginx:
image: nginx:alpine
register: output
- name: save output
debug:
var: output
- name: assert that container is running
assert:
that:
- "nginx.testing_nginx_1.state.running"
Quando executo com o comando ansible-playbook, tudo funciona bem e as tarefas assert retornam o seguinte:
TASK [test_role : assert that container is running] ************************************************************************************
ok: [testhost] => {
"changed": false,
"msg": "All assertions passed"
}
Mas quando executo exatamente o mesmo manual usando AWX, obtenho:
TASK [test_role : assert that container is running] ****************************
fatal: [testhost]: FAILED! => {"msg": "The conditional check 'nginx.testing_nginx_1.state.running' failed. The error was: error while evaluating conditional (nginx.testing_nginx_1.state.running): 'nginx' is undefined"}
Alguém tem uma ideia de por que isso está acontecendo?