mirror of
https://github.com/ansible-collections/community.docker.git
synced 2025-12-16 20:08:41 +00:00
Fix CI (docker_container tests fail because of missing ipaddress) (#218)
* Use stdlib ipaddress, resp. install when needed. * Make sure facts on controller are available.
This commit is contained in:
parent
4070dab9a8
commit
f4b1d34357
@ -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
|
||||
|
||||
|
||||
|
||||
@ -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:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user