mac_address no longer works with Docker API v1.44+. (#764)

This commit is contained in:
Felix Fontein 2024-01-20 14:06:29 +01:00 committed by GitHub
parent b2cee5677a
commit 648e0652d5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 39 additions and 36 deletions

View File

@ -524,6 +524,7 @@ options:
mac_address:
description:
- Container MAC address (for example, V(92:d0:c6:0a:29:33)).
- Note that the global container-wide MAC address is deprecated and no longer used since Docker API version 1.44.
type: str
memory:
description:

View File

@ -3010,7 +3010,9 @@ avoid such warnings, please quote the value.' in (log_options_2.warnings | defau
## mac_address #####################################################
####################################################################
- name: mac_address
- when: docker_api_version is version('1.44', '<')
block:
- name: mac_address
docker_container:
image: "{{ docker_test_image_alpine }}"
command: '/bin/sh -c "sleep 10m"'
@ -3019,7 +3021,7 @@ avoid such warnings, please quote the value.' in (log_options_2.warnings | defau
state: started
register: mac_address_1
- name: mac_address (idempotency)
- name: mac_address (idempotency)
docker_container:
image: "{{ docker_test_image_alpine }}"
command: '/bin/sh -c "sleep 10m"'
@ -3028,7 +3030,7 @@ avoid such warnings, please quote the value.' in (log_options_2.warnings | defau
state: started
register: mac_address_2
- name: mac_address (change)
- name: mac_address (change)
docker_container:
image: "{{ docker_test_image_alpine }}"
command: '/bin/sh -c "sleep 10m"'
@ -3038,14 +3040,14 @@ avoid such warnings, please quote the value.' in (log_options_2.warnings | defau
force_kill: true
register: mac_address_3
- name: cleanup
- name: cleanup
docker_container:
name: "{{ cname }}"
state: absent
force_kill: true
diff: false
- assert:
- assert:
that:
- mac_address_1 is changed
- mac_address_2 is not changed