diff --git a/molecule/ec2-centos-7/tests/test_default.py b/molecule/ec2-centos-7/tests/test_default.py index dfc4b52..f68c95d 100644 --- a/molecule/ec2-centos-7/tests/test_default.py +++ b/molecule/ec2-centos-7/tests/test_default.py @@ -22,6 +22,7 @@ def test_mosquitto_running_and_enabled(host): def test_mosquitto_socket(host): # Verify the socket is listening for HTTP traffic - ansible_vars = host.ansible.get_variables() - assert host.socket("tcp://{}:8883".format( - ansible_vars['ansible_default_ipv4']['address'])).is_listening + inventory = yaml.load(open(host.backend.ansible_inventory)) + address = inventory['all']['hosts']['bind_host']['ansible_host'] + assert host.socket( + "tcp://{address}:8883".format(address=address).is_listening