mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Backport of https://github.com/ansible-collections/community.docker/pull/66 to stable-1. (#1677)
This commit is contained in:
parent
a389969ace
commit
8a95fe8b00
3 changed files with 19 additions and 3 deletions
2
changelogs/fragments/community.docker-66-ipv6-zones.yml
Normal file
2
changelogs/fragments/community.docker-66-ipv6-zones.yml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
bugfixes:
|
||||||
|
- "docker_container - allow IPv6 zones (RFC 4007) in bind IPs (https://github.com/ansible-collections/community.docker/pull/66)."
|
|
@ -1721,7 +1721,7 @@ class TaskParameters(DockerBaseClass):
|
||||||
elif p_len == 3:
|
elif p_len == 3:
|
||||||
# We only allow IPv4 and IPv6 addresses for the bind address
|
# We only allow IPv4 and IPv6 addresses for the bind address
|
||||||
ipaddr = parts[0]
|
ipaddr = parts[0]
|
||||||
if not re.match(r'^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$', parts[0]) and not re.match(r'^\[[0-9a-fA-F:]+\]$', ipaddr):
|
if not re.match(r'^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$', parts[0]) and not re.match(r'^\[[0-9a-fA-F:]+(?:|%[^\]/]+)\]$', ipaddr):
|
||||||
self.fail(('Bind addresses for published ports must be IPv4 or IPv6 addresses, not hostnames. '
|
self.fail(('Bind addresses for published ports must be IPv4 or IPv6 addresses, not hostnames. '
|
||||||
'Use the dig lookup to resolve hostnames. (Found hostname: {0})').format(ipaddr))
|
'Use the dig lookup to resolve hostnames. (Found hostname: {0})').format(ipaddr))
|
||||||
if re.match(r'^\[[0-9a-fA-F:]+\]$', ipaddr):
|
if re.match(r'^\[[0-9a-fA-F:]+\]$', ipaddr):
|
||||||
|
|
|
@ -2914,9 +2914,22 @@ avoid such warnings, please quote the value.' in log_options_2.warnings"
|
||||||
published_ports:
|
published_ports:
|
||||||
- '127.0.0.1:9002:9002/tcp'
|
- '127.0.0.1:9002:9002/tcp'
|
||||||
- '[::1]:9003:9003/tcp'
|
- '[::1]:9003:9003/tcp'
|
||||||
|
- '[fe80::1%test]:90:90/tcp'
|
||||||
force_kill: yes
|
force_kill: yes
|
||||||
register: published_ports_5
|
register: published_ports_5
|
||||||
|
|
||||||
|
- name: published_ports (ports with IP addresses, idempotent)
|
||||||
|
docker_container:
|
||||||
|
image: "{{ docker_test_image_alpine }}"
|
||||||
|
command: '/bin/sh -c "sleep 10m"'
|
||||||
|
name: "{{ cname }}"
|
||||||
|
state: started
|
||||||
|
published_ports:
|
||||||
|
- '127.0.0.1:9002:9002/tcp'
|
||||||
|
- '[::1]:9003:9003/tcp'
|
||||||
|
- '[fe80::1%test]:90:90/tcp'
|
||||||
|
register: published_ports_6
|
||||||
|
|
||||||
- name: published_ports (no published ports)
|
- name: published_ports (no published ports)
|
||||||
docker_container:
|
docker_container:
|
||||||
image: "{{ docker_test_image_alpine }}"
|
image: "{{ docker_test_image_alpine }}"
|
||||||
|
@ -2927,7 +2940,7 @@ avoid such warnings, please quote the value.' in log_options_2.warnings"
|
||||||
comparisons:
|
comparisons:
|
||||||
published_ports: strict
|
published_ports: strict
|
||||||
force_kill: yes
|
force_kill: yes
|
||||||
register: published_ports_6
|
register: published_ports_7
|
||||||
|
|
||||||
- name: cleanup
|
- name: cleanup
|
||||||
docker_container:
|
docker_container:
|
||||||
|
@ -2943,7 +2956,8 @@ avoid such warnings, please quote the value.' in log_options_2.warnings"
|
||||||
- published_ports_3 is not changed
|
- published_ports_3 is not changed
|
||||||
- published_ports_4 is changed
|
- published_ports_4 is changed
|
||||||
- published_ports_5 is changed
|
- published_ports_5 is changed
|
||||||
- published_ports_6 is changed
|
- published_ports_6 is not changed
|
||||||
|
- published_ports_7 is changed
|
||||||
|
|
||||||
####################################################################
|
####################################################################
|
||||||
## pull ############################################################
|
## pull ############################################################
|
||||||
|
|
Loading…
Reference in a new issue