From 9772748b17fa240d8a6c9fde9b67eac6fe0bd8a1 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Mon, 10 Jun 2019 18:18:20 +0200 Subject: [PATCH] try to use debug to access ansible facts from molecule --- molecule/ec2-centos-7/tests/test_default.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/molecule/ec2-centos-7/tests/test_default.py b/molecule/ec2-centos-7/tests/test_default.py index 3ddb355..9818a0b 100644 --- a/molecule/ec2-centos-7/tests/test_default.py +++ b/molecule/ec2-centos-7/tests/test_default.py @@ -1,5 +1,4 @@ import os -import yaml import testinfra.utils.ansible_runner @@ -23,7 +22,6 @@ def test_mosquitto_running_and_enabled(host): def test_mosquitto_socket(host): # Verify the socket is listening for HTTP traffic - inventory = yaml.load(open(host.backend.ansible_inventory)) - address = inventory['all']['hosts']['bind_host']['ansible_host'] + address = host.ansible("debug", "var=ansible_default_ipv4.address") assert host.socket( "tcp://{address}:8883".format(address=address)).is_listening