diff --git a/tests/integration/targets/docker_container/filter_plugins/ipaddr_tools.py b/tests/integration/targets/docker_container/filter_plugins/ipaddr_tools.py index 1b809aae..29f6552e 100644 --- a/tests/integration/targets/docker_container/filter_plugins/ipaddr_tools.py +++ b/tests/integration/targets/docker_container/filter_plugins/ipaddr_tools.py @@ -18,10 +18,10 @@ from __future__ import absolute_import, division, print_function __metaclass__ = type -from ansible_collections.community.crypto.plugins.module_utils.compat import ipaddress - def _normalize_ipaddr(ipaddr): + # Import when needed, to allow installation of that module in the test setup + import ipaddress return ipaddress.ip_address(ipaddr).compressed diff --git a/tests/integration/targets/docker_container/tasks/main.yml b/tests/integration/targets/docker_container/tasks/main.yml index bbed2817..66e3d7bc 100644 --- a/tests/integration/targets/docker_container/tasks/main.yml +++ b/tests/integration/targets/docker_container/tasks/main.yml @@ -4,6 +4,19 @@ # and should not be used as examples of how to write Ansible roles # #################################################################### +- name: Gather facts on controller + setup: + gather_subset: '!all' + delegate_to: localhost + delegate_facts: true + run_once: true + +- name: Make sure ipaddress is available on controller + pip: + name: ipaddress + delegate_to: localhost + when: hostvars['localhost'].ansible_facts.python.version.major < 3 + # Create random name prefix (for containers, networks, ...) - name: Create random container name prefix set_fact: